Plink script

Hello,

I’m using plink as follows:

PLINK.EXE -ssh -P 22 user@host -pw passwd -m MK.ini

When I try to run a script with commands that go into menu level does not recognize. Ex:

/system upgrade
:put [get [find version=6.42.10] status]

If you do in a single line it works. Ex:

/system upgrade;:put [get [find version=6.42.10] status]

Would anyone know the reason?

In your example, “;” is still required at the end of the first line. It stands for “New Line.”

:put [system identity get name] works for me

Not true anymore “New Line” works nice. No need for ; anymore.
Only if you like more commands on one line.

https://wiki.mikrotik.com/wiki/Manual:Scripting
The end of command line is represented by the token “;” or NEWLINE. Sometimes “;” or NEWLINE is not required to end the command line.

I completely miss read the OP issue! Thought he was trying to issue 2 commands when I responded.

My intention is to first enter the menu level

/system upgrade

to execute later

:put [get [find version=6.42.10] status]

as it would in a mikrotik script

/system upgrade;:put [get [find version = 6.42.10] status]

This does not work for me, it gives red error after = due to the extra space after =.
If I do remove the space, I do get this error:
no such item

What are you trying to do?
Test what version you have?
See if there are newer version?

If you like OS version?

:put [/system resource get version]

Sorry, the spaces were a copy and paste error. They should not really exist.

If I run direct on the terminal it works, the problem is when I try to do this through plink.

This is part of a mass update script where I need to know if the download has been completed to reboot.