System information
Manual:Scripting
35
resolver failed
lala
Operations with Arrays
Warning: Key name in array contains any character other than lowercase character, it should be put in quotes
For example:
[admin@ce0] > {:local a { "aX"=1 ; ay=2 }; :put ($a->"aX")}
2
Loop through keys and values
foreach command can be used to loop through keys and elements:
[admin@ce0] > :foreach k,v in={2; "aX"=1 ; y=2; 5} do={:put ("$k=$v")}
0=2
1=5
aX=1
y=2
Note: If array element has key then these elements are sorted in alphabetical order, elements without keys are
moved before elements with keys and their order is not changed (see example above).
Script repository
Sub-menu level: /system script
Contains all user created scripts. Scripts can be executed in several different ways:
• on event - scripts are executed automatically on some facility events ( scheduler, netwatch, VRRP)
• by another script - running script within script is allowed
• manually - from console executing run command or in winbox
Property Description
name (string; Default: "Script[num]") name of the script