LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: Disabled
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
 
Old 09-10-2014, 05:49 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,923

Rep: Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319
I do not really understand what you wrote, but actually I think you gave insufficient information.
 
Old 09-10-2014, 02:30 PM   #3
jreswick
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.

Jim
 
  


Reply



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 04:02 AM
Execute commands or scripts on a remote server gurl4sh25 Linux - Software 3 06-27-2007 09:04 PM
Remote Desktop, ssh, vnc, rdesktop, RDP, cygwin? chbin Linux - Networking 7 12-17-2005 05:28 PM
Unable to execute sh scripts zowey Mandriva 2 12-23-2004 03:59 PM
Remote X with Cygwin, ssh problems kuronai Linux - Networking 3 06-03-2004 04:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:27 PM.

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