:local test ("MT test :: " . ([/system identity get name]) . " :: " .([/system clock get date]) );
:log info $test;
Now i wont to add this script via command line:
system script add name="test" policy=read source={:local test ("MT test :: " . ([/system identity get name]) . " :: " .([/system clock ge
t date]) );
{... :log info $test;}
but the result in the winbox is only one line (including character enter), so the question is how to add script from command line in order to get 2 lines in winbox?
The solution is to enter a new line “\n” and a carriage return “\r” to where you want the line break. I found the order of the carriage return and newline to matter. CR must come first (eg. \r\n). This is on ROS v5.20.
Example
/system script add name=UpdateNTPServers policy=ftp,
read,write,policy,test,winbox,api source="/system ntp client set primary-
ntp=[:resolve 0.north-america.pool.ntp.org]\r\n/system ntp client set sec
ondary-ntp=[:resolve time.nist.gov]"
When I had \n\r, it entered as one line. When I reversed to \r\n, as above, it shows up in Winbox on two lines, as expected.