Re: [dev] New utility "when"

From: Rob <robpilling_AT_gmail.com>
Date: Thu, 12 Dec 2013 00:18:45 +0000 (GMT)

On Thu, 12 Dec 2013, Fernando C.V. wrote:
> On Wed, Dec 11, 2013 at 10:36 PM, Rob <robpilling_AT_gmail.com> wrote:
>> [local-machine %] ssh user_AT_host & && xmessage connected
>> [ssh-machine %] ...
>>
>> `xmessage connected' will be executed even though ssh hasn't exit(0)'d
>> yet.
>
> bash: syntax error near unexpected token `&&'
>
> You probably meant this:
>
> $ { ssh user_AT_host &; } && xmessage connected
>
> Still, you would always be running "xmessage connected" even in the
> case of "ssh user_AT_host" failing, which is not what he wants.

Sorry yeah, I didn't clarify enough - meant to say that it wasn't
actually a valid shell script, I was just saying what it would be sort
of like.

But obviously it can't be done in shell, even with your {} / () subshell
stuff, since we can't tell if ssh has connected until it exits (without
a decent bit of hackery anyway).


Rob
Received on Thu Dec 12 2013 - 01:18:45 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 12 2013 - 01:24:06 CET