Community discussions

MikroTik App
 
khaled95
just joined
Topic Author
Posts: 1
Joined: Sun Nov 08, 2020 2:41 pm
Location: Damascus
Contact:

Send output to a file

Sun Nov 08, 2020 3:14 pm

Hi everyone
I made a simple script that will assign the number of addresses in an address list to a variable and send that value to a file
this is the script:

{
:local addList;
:set addList [len [/ip firewall address-list find where list=UEDU]];
:execute {:put $addList;} file="addressList.txt";
}

It works perfectly fine on terminal but it doesn't work when I put it in /system script
also I cannot find the variable $addList in environment when I run it from /system script but it will be created when I run the script from terminal
I also tried to set the variable to global instead of local but the same thing happen.
The OS version is 6.42.7
Thanks in advance

Who is online

Users browsing this forum: No registered users and 25 guests