LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to execute remote scripts through SSH from Cygwin (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-execute-remote-scripts-through-ssh-from-cygwin-4175518022/)

jreswick 09-09-2014 01:16 PM

Unable to execute remote scripts through SSH from Cygwin
 
Hi:

I'm trying to run a command string on a Linux box from a Winows 2008 box. I've got Cygwin64 installed and ssh working with public keys. I have two test scripts on the Windows box. The first script contains the command line that I desire to execute on the Linux box. The second script calls the first script passing the command line in the first script to the Linux box for execution (at least that is what is intended).

Here is the first script executed in the Cygwin session on the Windows box:

srv_imgctrlmsqladmin@RCOVSVR0414 ~
$ . /home/srv_imgctrlmsqladmin/test2.sh
hello world

Here is the command line from the second script copied and pasted and executed in the Cygwin session:

srv_imgctrlmsqladmin@RCOVSVR0414 ~
$ /bin/ssh rcolnx89114 -l sukpewek 'bash -s' < /home/srv_imgctrlmsqladmin/test2.sh
hello world

Here is what I get when I execute the second script in the Cygwin session (that contains only the same command line as above):

srv_imgctrlmsqladmin@RCOVSVR0414 ~
$ . /home/srv_imgctrlmsqladmin/call_test.sh
: No such file or directorydmin/test2.sh

I've tried several other variations of the same process above, but its always the same thing...Command line works fine on the remote Linux box, but the script calling the identical command line does not.

I'm a newbie and no great Unix script coder, and any help would be much appreciated...

Jim

pan64 09-10-2014 05:49 AM

I do not really understand what you wrote, but actually I think you gave insufficient information.

jreswick 09-10-2014 02:30 PM

Hi Pan64:

Thanks for your response. I apologize for the confusion. However, I have resolved the issue: DOS end-of-line characters in scripts. I've converted scripts to Unix end-of-line and they work.

Jim


All times are GMT -5. The time now is 08:04 PM.