[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Waiting for _any_ background process to terminate.
From: |
Chet Ramey |
Subject: |
Re: Waiting for _any_ background process to terminate. |
Date: |
Mon, 11 Feb 2013 15:05:25 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
On 2/11/13 1:59 PM, Alan Mackenzie wrote:
> Hi, bug-bash.
>
> From a bash script, I'd like to be able to start several subtasks and
> react to any one of them completing. I don't think I can do this with
> the current bash. The `wait' function either waits on a specified subtask
> to finish, or for _all_ subtasks to finish.
>
> Am I mistaken about this perceived lack? If not, would it be possible
> to add this functionality into bash?
Right now, you have to build your own using a SIGCHLD trap. The next
version of bash will have `wait -n', which will wait for the next process
to change state.
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/