bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: && operator prevents backgrounding over ssh


From: Chet Ramey
Subject: Re: && operator prevents backgrounding over ssh
Date: Thu, 26 Sep 2013 15:48:07 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 9/26/13 10:52 AM, Greg Wooledge wrote:
> On Thu, Sep 26, 2013 at 06:27:10AM +0000, Hinrik Örn Sigurðsson wrote:
>> The "&&" operator in bash seems to inhibit backgrounding when run over
>> ssh. You can try it with the following:
>>
>>   ssh localhost "cd /tmp && nohup sleep 10 >/dev/null 2>&1 &"
>>
>> The above command will wait for sleep(1) to finish before returning.
> 
> Confirmed on HP-UX 10.20 with bash 4.2.37.  Changing && to ; causes
> an immediate return.

Those two are not equivalent; `&&' and `;' have different precedence.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]