I am trying to pass arguements to a local script to be executed on a remote machine. The script works fine as I have tested it passing variables in manually. I am trying to use plink for this. I take in username (arg to be passed to script) and need to send it along with the script via plink. The command I'm using is:
plink.exe ubuntu@192.168.198.128 -m "myLocalScript.ksh"
I have also tried:
plink.exe ubuntu@192.168.198.128 -m "myLocalScript.ksh %username%"
plink.exe ubuntu@192.168.198.128 -m %username% < "myLocalScript.ksh"
I've tried piping the arguments in, and adding them to various places in the command etc. Does anyone know how I can achieve this?
Edit: I am using this from cmd.exe rather than cygwin. They -m option does the following:
-m file read remote command(s) from file