Paul Jarc wrote: > Dolphin06 wrote: > > Can i do something like this : > > ssh $u...@$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 $u...@$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 $u...@$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