Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21267

Scripting • Re: :execute output to console? Or any other method?

$
0
0

Since I do not know what your trying to accomplish.., but a alternative to :execute is using :parse and another [] around it to execute it:
Code:
[[:parse ":export"]]
Perfect, didn't know you could double wrap it. This is the answer and works perfectly

So here is the version agnostic command for anyone else who is interested
Code:
:if ([:tonum [:pick [/system package get 0 version] 0]] >= 7 ) do={[[:parse "/export terse show-sensitive"]]} else={[[:parse "/export terse"]]}

On latest version of v7 both show-sensitive and hide-sensitive are supported, so if is run v6-like command, is accepted.
The problem is I need to be able to run just a single command and have it spit out output, since the software will read what is immediately after the command entered and store that as the config, can't run 2 commands or detect errors. And ROS6 is 'not' compatible with the show-sensitive suffix it couldn't be used

Statistics: Posted by millenium7 — Thu Jan 09, 2025 2:23 am



Viewing all articles
Browse latest Browse all 21267

Trending Articles