bug-bash
[Top][All Lists]
Advanced

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

Re: wait -n shouldn't collect multiple processes


From: Chet Ramey
Subject: Re: wait -n shouldn't collect multiple processes
Date: Sun, 24 Mar 2019 11:33:31 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.0

On 3/23/19 12:31 PM, Robert Elz wrote:

>   | If you want to associated an exit status with a process, changing wait -n
>   | wouldn't make a difference.
> 
> It does when you add the "-p var" option, which returns the pid of the
> process (job) that exited as $var

If I add that, I might change the semantics of `wait -n' to match the
NetBSD shell's in the case where -n and -p are both supplied.

> 
>   | What's your goal here? If you want to associate an exit status with a
>   | process, you're going to have to save $! and wait for each process in
>   | turn.
> 
> That involves predicting what order the processes are going to exit.

Sure. That isn't the case here, though. A SIGHLD trap should do the job
Ben needs.

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



reply via email to

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