Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-09-2014, 02:16 PM   #1
LQ Newbie
Registered: Sep 2014
Posts: 3

Rep: Reputation: Disabled
Unable to execute remote scripts through SSH from Cygwin


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/
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/
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/
: No such file or directorydmin/

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...

Old 09-10-2014, 06:49 AM   #2
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 10,269

Rep: Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018Reputation: 3018
I do not really understand what you wrote, but actually I think you gave insufficient information.
Old 09-10-2014, 03:30 PM   #3
LQ Newbie
Registered: Sep 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unable to execute simple bash scripts wang Linux - Newbie 17 12-26-2010 05:02 AM
Execute commands or scripts on a remote server gurl4sh25 Linux - Software 3 06-27-2007 10:04 PM
Remote Desktop, ssh, vnc, rdesktop, RDP, cygwin? chbin Linux - Networking 7 12-17-2005 06:28 PM
Unable to execute sh scripts zowey Mandriva 2 12-23-2004 04:59 PM
Remote X with Cygwin, ssh problems kuronai Linux - Networking 3 06-03-2004 05:18 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration