Re: chaining ssh commands

From: Darren Tucker (dtucker_at_gate.dodgy.net.au)
Date: 09/26/05


Date: 26 Sep 2005 09:12:53 GMT

On 2005-09-26, Jacques-Olivier Haenni <jo_no_spam@haenni.info> wrote:
> This can simply be performed as follows:
>
> ssh me@remotebox 'cd /usr/me; tar -xvf me.tar'

Note that if the "cd" fails it will still run the second command.
In this example it's probably not a big deal, but under other conditions
it might be.

To prevent that, use "&&" instead, eg:
$ ssh me@remotebox 'cd /usr/me && tar -xvf me.tar'

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


Relevant Pages

  • Re: Problem compiling OpenSSH 4.2p1 on Tru64 UNIX 4.0F
    ... Trying to compile 4.2p1, the make fails. ... The quick fix is to replace that definition by hand with whatever the ... Good judgement comes with experience. ...
    (SSH)
  • Re: Bad utmp entry
    ... Darryl Baker wrote: ... Ufortunately configure in 4.3p1 fails to detect utmp structs correctly. ... Good judgement comes with experience. ...
    (SSH)
  • Re: scp
    ... from the internal system, but this fails. ... (try scp -vvv otheroptions to see what it's doing under the covers). ... Good judgement comes with experience. ...
    (comp.security.ssh)
  • Re: Need to add this code to my website to hide my email from spam bots
    ... Danny writes: ... This fails, badly. ... 'Faith without judgement merely degrades the spirit divine.' ...
    (comp.lang.javascript)