[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: command not found on remote server
From: |
Bob Proulx |
Subject: |
Re: command not found on remote server |
Date: |
Thu, 11 Dec 2008 14:14:36 -0700 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Paul Jarc wrote:
> Dolphin06 wrote:
> > Can i do something like this :
> > ssh $USER@$SERVER export PATH=$PATH:/other path/ ; script param....
>
> You'd have to quote the sequence of commands that should run on the
> remote host, so that the local bash and ssh see it as all one parameter:
> ssh $USER@$SERVER 'export PATH=$PATH:/other path/ ; script param....'
I find it much less confusing for all involved to use stdin piped to
the remote shell. Try this instead.
ssh $USER@$SERVER sh <<'EOF'
export PATH=$PATH:/otherpath/
script param....
EOF
Use "EOF" instead if you want $variables to be expanded locally in the
script but then you need to be aware of the local expansion and quote
any that you don't want expanded.
Also, using full paths is frowned upon.
Bob