[Top][All Lists]

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

Re: [Help-bash] command substitution $( ) waits for child’s &

From: Seth David Schoen
Subject: Re: [Help-bash] command substitution $( ) waits for child’s &
Date: Fri, 29 May 2015 16:45:33 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Seth David Schoen writes:

> There is nothing in Unix IPC that lets script x distinguish between these
> cases, in terms of knowing for sure whether script y will _eventually_
> give more output or not, until script y has exited.  (After all, processes
> that are running in the background are still allowed to write output on
> stdout; they aren't necessarily promising to remain quiet.)

I'm sorry, on further reflection the distinction does seem possible: if
the background process were detached from the shell's process group,
then even though it's _possible_ for it to continue to give output, the
original shell process may have exited along with its entire process
group.  So I would then expect either

sleep 3 &
disown -a


setsid sleep 3 &

to do something like what you want.  Neither of these worked for me on
bash-4.3.30, so I'm now also slightly puzzled by the situation!

Seth David Schoen <address@hidden>      |  No haiku patents        |  means I've no incentive to
  FD9A6AA28193A9F03D4BF4ADC11B36DC9C7DD150  |        -- Don Marti

reply via email to

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