bug-bash
[Top][All Lists]
Advanced

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

Re: Checking executability for asynchronous commands


From: Chet Ramey
Subject: Re: Checking executability for asynchronous commands
Date: Sat, 26 Dec 2020 15:16:23 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 12/26/20 4:10 AM, Markus Elfring wrote:
If you want the exit status of the child process, add `wait $!'

Thanks for this information.

Is there a need then to point the aspect out that exit values can be determined
for child processes even if they terminated before a wait command would be 
performed?


Is this what you mean? If you have the pid of an asynchronous command --
and the easiest way to get that pid is by referencing $! after it was
started -- you can call `wait' with that pid to retrieve the status, even
if it's already terminated.


--
``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]