:range command

What specifically are you trying to update with scripting? VLAN bridge ports, bridge vlans, interface-list, etc & what settings etc?

Updating (“set”) is more tricky than adding. Mainly because you need may need to add OR set, depending on what you mean by “update a VLAN”.

More generally, learning how “find” works is probably the most important trick here. While :range can generate a list of numbers, and those could be VLAN IDs or the part of ether0X names etc., it’s not really useful for “set”. Since I mentioned that “set” only works on existing entires, if the “update” you were looking for is either adding a VLAN or setting something on existing. And “updating” things is where you need typically need some “find”. The reason is “find” returns a list of .id’s… and it’s the “id” is what you need to use in any CLI “set” operation.

The /interface/bridge/vlan settings are particular hard in scripting, which is why all the code in the other thread appears more complex than needed… So dealing with trunk ports gets tricky. See Append Bridge vlan values(http://forum.mikrotik.com/t/append-bridge-vlan-values/147015/1) which has more examples and context.