Community discussions

 
Okietim
just joined
Topic Author
Posts: 15
Joined: Tue Feb 14, 2017 9:54 pm
Location: Oklahoma

":put" problem in scripting

Tue Jan 01, 2019 4:16 am

Unable to use :put to display contents of global var from within script.
Terminal cli works fine and can see that global var is changed from script, just no output on console
when initiated from script.
Using 6.43.7 and latest Winbox.
Have searched forum and google for answer without success.
Suggestions appreciated.
2018-12-31_17-56-01.jpg
console.jpg
You do not have the required permissions to view the files attached to this post.
 
mducharme
Trainer
Trainer
Posts: 799
Joined: Tue Jul 19, 2016 6:45 pm

Re: ":put" problem in scripting  [SOLVED]

Tue Jan 01, 2019 4:38 am

This is normal behavior. If you want the script to print output while it runs, use the :log command which will output to the system log.
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1785
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: ":put" problem in scripting

Tue Jan 01, 2019 4:42 am

:put outputs in current session, but since the script is run in separate thread with it's own environment, the output won't be visible.
If you were to call on it from a shell you have open, it will output: "/system script run script1"
Another option: use :log
 
Okietim
just joined
Topic Author
Posts: 15
Joined: Tue Feb 14, 2017 9:54 pm
Location: Oklahoma

Re: ":put" problem in scripting

Tue Jan 01, 2019 6:15 pm

This is normal behavior. If you want the script to print output while it runs, use the :log command which will output to the system log.
Thank you mducharme! Now I know the answer.
 
Okietim
just joined
Topic Author
Posts: 15
Joined: Tue Feb 14, 2017 9:54 pm
Location: Oklahoma

Re: ":put" problem in scripting

Tue Jan 01, 2019 6:16 pm

:put outputs in current session, but since the script is run in separate thread with it's own environment, the output won't be visible.
If you were to call on it from a shell you have open, it will output: "/system script run script1"
Another option: use :log
Thank you sebastia! I'll give that a try.

Who is online

Users browsing this forum: No registered users and 11 guests