I try to execute a shell file in a remote server using Plink from a Batch file. Both files are on my local machine. Everything work but the parameters I try to get back in my shell file : Here is what I did
Shell file 'test.sh':
#!/bin/sh
echo Get parameter 1
echo ${1}
echo Get parameter 2
echo $2
Batch file 'test.cmd':
@ECHO OFF
plink.exe myuser@MYHOST -batch -ssh -m test.sh param1 param2
Result:
D:\path>test.cmd
Get Parameter 1
Get Parameter 2
D:\path>
Shell commands return empty parameters