OVMS remote command execution using Plink

503 Views Asked by At

I am trying to execute a remote command on a OVMS server using plink. When I try executing a simple command its working fine:

plink -ssh -l USERID HOST-pw PASSWORD DIR

But when i start using some complex command it is throwing error:

plink -ssh -l USERID HOST-pw PASSWORD wnb search/keys="TRN|0567 6789"/log/sys

Please suggest.

1

There are 1 best solutions below

0
vmsnomad On

Trials and errors yield their fruits. Indeed as Hein was suggesting, the issue was with quotes not being properly transmitted, yet with different syntax.

Here's the syntax that worked for me (Windows:plink(0.63) >> VMS):

plink -ssh -l USER HOST -pw PWD "mycommand arg, """quoted arg1""", """quoted arg2""" /opt1 /opt2"

on VMS results in:

mycommand arg, "quoted arg1", "quoted arg2" /opt1 /opt2

THUS: plink>>VMS double-quote=""", but may still have trouble with < > | << >> chars as these are confused for pipes by Windows cmd CLI.

BETTER: use plink -m cmds-file option to pass remote commands in a local file:

plink -ssh -l USER HOST -pw PWD -m cmds.vms

where cmd.vms file contains:

mycommand arg, "quoted arg1", "piped|arg" /opt1 /opt2