bug-bash
[Top][All Lists]
Advanced

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

Re: wait -n misses signaled subprocess


From: Dale R. Worley
Subject: Re: wait -n misses signaled subprocess
Date: Sun, 28 Jan 2024 22:26:27 -0500

Chet Ramey <chet.ramey@case.edu> writes:
>> echo "wait -n $pid return code $? @${SECONDS} (BUG)"
>
> The job isn't in the jobs table because you've already been notified about
> it and it's not `new', you get the unknown job error status.

The man page gives a lot of details and I'm trying to digest them into a
structure.

It looks like the underlying meaning of "-n" is to only pay attention to
*new* job completions, and anything "in the past" (already notified and
moved to the table of terminated background jobs) is ignored.

The underlying meaning of providing one or more ids is that "wait" is to
only be concerned with those jobs.

The man page doesn't make clear that if you don't specify "-n" and do
supply ids and one of them has already terminated, you'll get its status
(from the terminated table); the wording suggests that "wait" will
always *wait for* a termination.

There's also an interaction in that "wait" will only look at the
terminated table if "-n" is not specified *and* ids are specified.

Am I understanding this correctly?

Dale



reply via email to

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