Yes it does when working with variables. String arrays and key, value arrays are another story. Ultimately I was able to solve the problem. Here’s how:
# Previously defined/assigned string array
:global FOinterfaces
# Previously defined/assigned key, value array
:global FOpingHosts
#Convert the string array to a string variable, need to insert the quotes
:global FOSinterfaces ""
:foreach i in=$FOinterfaces do={
:if ([:len $FOSinterfaces] = 0) do={ :set FOSinterfaces ("\"".$i."\"") } else={ :set FOSinterfaces ($FOSinterfaces.";\"".$i."\"") }
}
#Convert the key, value array to a string. Need to quote the value
:global FOSpingHosts ""
:foreach k,v in=$FOpingHosts do={
:if ([:len $FOSpingHosts] = 0) do={ :set FOSpingHosts ($k."=\"".$v."\"") } else={ :set FOSpingHosts ($FOSpingHosts.";".$k."=\"".$v."\"") }
}
/system script
add dont-require-permissions=no name=success owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="
\n:global FLinterfaces {$FOSinterfaces}\r\
\n:global FLpingHosts {$FOSpingHosts}\r\
...............