bug-bash
[Top][All Lists]
Advanced

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

Re: 'wait -n' with and without id arguments


From: Chet Ramey
Subject: Re: 'wait -n' with and without id arguments
Date: Wed, 21 Aug 2024 09:25:12 -0400
User-agent: Mozilla Thunderbird

On 8/14/24 4:42 PM, Robert Elz wrote:
     Date:        Wed, 14 Aug 2024 15:21:44 -0400
     From:        Chet Ramey <chet.ramey@case.edu>
     Message-ID:  <1413a9a0-cbef-44c5-8072-a3be7294e8e0@case.edu>

   | I'm not sure returning the status of some random process from some
   | arbitrary point in the past is going to be valuable.

Not "some random process" but a process that has terminated, and hasn't
been waited upon before (and which hasn't been notified as complete via
an explicit user execution of the "jobs" command or the implicit "jobs"
which runs just before each PS1 output in an interactive shell).

I suppose we could do this for `wait -n', but removing processes from
the saved statuses list after `wait pid' only happens in posix mode.
In default mode, bash allows you to wait for a process more than once.
We've covered this before; it comes up every time.


   | Maybe the thing to do is to retain jobs in the job list, even after
   | they're marked as notified,

I'd do the opposite, once they're notified, they should be deleted
from the jobs table, and everywhere else.   But "notified" only happens
when the script explicitly asks (in a non-interactive shell, never because
of any other event than an appropriate command issued by the script, and
in an interactive shell, the same, or the implicit "jobs" before each PS1).

We're only talking about interactive shells here.


Once deleted, they're gone, and there's no way to get data from them,
ever again.

This should not require any magic options.

It works this way in posix mode.


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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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