Re: executing ssh from shell script



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@xxxxxxxxxxx ~/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@xxxxxxxxxxx "testscripts/copyexecutable"

I always quote remote commands out of habit although they shouldn't be
required unless there are spaces.
.



Relevant Pages