|
From: | Philip Prindeville |
Subject: | Re: Wanted: bash enhancement... non-blocking 'wait' |
Date: | Fri, 03 Sep 2010 13:12:06 -0700 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 |
On 9/3/10 10:44 AM, Eric Blake wrote:
On 09/02/2010 04:44 PM, Philip Prindeville wrote:I wanted to check in and see if there was a chance of this feature being accepted upstream before I spent any time on it... so here goes. The "wait [n]" command is handy, but would be even handier is: wait [[-a] n] instead, which asynchronously checks to see if process 'n' has completed.What's wrong with using the existing 'kill -0 pid' to check if pid still exists, rather than inventing a new argument to 'wait'?
Well, in theory, if you waited long enough (to look for the process), and it had exited and a new process with that id was created, you'd detect the wrong process. At least with 'wait' you're guaranteed it's still in your process-group, right? Besides, 'wait' is just a lot easier to read and understand... not everyone knows the system call semantics of kill().
[Prev in Thread] | Current Thread | [Next in Thread] |