This is a discussion on executing ssh from shell script within the Linux Networking forums, part of the Linux Forums category; Hi, I am trying to execute a shell script on a remote machine using a shell script on the local ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I am trying to execute a shell script on a remote machine using a shell script on the local machine. I am not getting any errors but the remote script is not getting executed. Can you please tell me where I am going wrong. The local shell script is as follows. #!/bin/sh ssh root@10.10.1.180 ~/testscripts/copyexecutable exit The copyexecutable script works fine if I ssh into the remote machine and execute it from the command prompt. TIA, R C |
|
|||
|
R C V wrote:
> Hi, > I am trying to execute a shell script on a remote machine > using a shell script on the local machine. I am not getting any > errors but the remote script is not getting executed. > > Can you please tell me where I am going wrong. > The local shell script is as follows. > > #!/bin/sh > ssh root@10.10.1.180 ~/testscripts/copyexecutable The tilda will be expanded by your local shell; try quoting it. Robert > exit > > The copyexecutable script works fine if I ssh into the remote machine > and execute it from the command prompt. > > TIA, > R C |
|
|||
|
On Wed, 19 Mar 2008 08:38:17 +0000, Robert Harris wrote:
> R C V wrote: > >> I am trying to execute a shell script on a remote machine >> using a shell script on the local machine. I am not getting any errors >> but the remote script is not getting executed. >> >> Can you please tell me where I am going wrong. The local shell script >> is as follows. >> >> #!/bin/sh >> ssh root@10.10.1.180 ~/testscripts/copyexecutable > > The tilda will be expanded by your local shell; try quoting it. If no absolute path is given the default directory in the ssh session will be the remote user's home directory. Try ssh root@10.10.1.180 "testscripts/copyexecutable" I always quote remote commands out of habit although they shouldn't be required unless there are spaces. |