Scripting Engine bug or am I missing something?

I’ve got this basic script and it is not behaving as expected:
:foreach iplist in=[/ip firewall address-list find where list=“LIST NAME HERE”] do={:local ip “$[/ip firewall address-list get $iplist address ;],$ip”; :put $ip}

I’ve noticed that RouterOS is including the list name in the output, which I’m not sure why and It is not the list name your actually targeting. For me it included the address list name from the list numbered one lower than the first list found.

This can not bee your whole script? It do miss an end }

You are using variable the wrong way, see my post yesterday here:
http://forum.mikrotik.com/t/need-help-picking-array-values/143407/3

Thank you sir. I quickly see the error in how I had done it :wink:

My working test code:

:global ip ""; :foreach iplist in=[/ip firewall address-list find where list="list-bogons"] do={:set $ip "$[/ip firewall address-list get $iplist address ;],$ip"; :put $ip}