Run .sh file in linux machine via putty

Posted by Prateek on Super User See other posts from Super User or by Prateek
Published on 2012-09-18T14:02:49Z Indexed on 2012/09/18 15:42 UTC
Read the original article Hit count: 371

Filed under:
|

I want run an .sh file which take an argument in a Linux machine. I'm using plink.exe to execute this .sh file from a windows machine. But I don't know what to write in the batch file in order to run plink.exe which in turn executes the .sh file and this file arguement.

I have written following batch command:

@echo off  
start C:\Users\Prateek\Desktop\PLINK.EXE -ssh -P 22 user@host -pw password sh -x  "/home/user/copy.sh"

On executing it, I get:

+ echo ''  

+ echo 'Enter partner id'  
Enter partner id  
+ read pid  
:  

Actually 'Enter partner id' is the argument, which I need to pass.

© Super User or respective owner

Related posts about putty

Related posts about plink