[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'wait -n' with and without id arguments
From: |
Zachary Santer |
Subject: |
Re: 'wait -n' with and without id arguments |
Date: |
Fri, 9 Aug 2024 15:20:52 -0400 |
On Fri, Aug 9, 2024 at 2:52 PM Greg Wooledge <greg@wooledge.org> wrote:
>
> The problem is that our entire understanding of what "wait -n" DOES has
> been annihilated. We thought it would "trigger" exactly once for every
> completed background process, regardless of whether they completed
> before or after calling "wait -n", which would allow the writing of an
> N-jobs-at-a-time thing. It turns out this is incorrect.
My understanding is that it actually does this reliably, but only when
it's in a script. The attached was basically my take on your example,
obviously with infinite dummy tasks and sleeping in the parent shell.
Feel free to mess around with it. The loop only terminates when the
script is sourced from the interactive shell.
If it wasn't made clear in the earlier discussion that what bash is
doing that makes this unreliable is only a factor in the interactive
shell, then I wasn't the only one missing something.
wait-n-failure
Description: Binary data
Re: 'wait -n' with and without id arguments, Chet Ramey, 2024/08/09
Re: 'wait -n' with and without id arguments, Zachary Santer, 2024/08/09