On Thu, Jan 30, 2025 at 8:27 PM Muhammed Mahmood
wrote:
> I'm curious as to why you think that it's not worth it for this functionality
> to be in an option.
Fewer options to remember the better.
> Actually, upon closer inspection, the line of code you shared still seems a
> bit incomplete.
Y
Date:Thu, 30 Jan 2025 11:00:36 -0600
From:MacBeth
Message-ID:
| errwait() { while wait -n || return; do :; done; }
Yes, that would also be good (could have the -p added as well if desired).
kre
On Thu, Jan 30, 2025 at 2:02 AM Robert Elz wrote:
> Date:Thu, 30 Jan 2025 06:03:18 +0300
> From:=?UTF-8?B?T8SfdXo=?=
> Message-ID: m3wdtjk0dfztgmfoggt2du...@mail.gmail.com>
>
> I'd suggest putting it in a function, something like
>
> wait_for_error() {
>
Date:Thu, 30 Jan 2025 06:03:18 +0300
From:=?UTF-8?B?T8SfdXo=?=
Message-ID:
| `while wait -n; do :; done' already does that
Not quite, after that loop $? = 0 (always) so there's no way to
tell whether or not one of the commands failed, which I suspect
was the orig
On Wednesday, January 29, 2025, Muhammed Mahmood via Bug reports for the
GNU Bourne Again SHell wrote:
>
> Ideally, there should be a wait -e which waits for every child process but
> exits on the first non zero exit code received.
>
`while wait -n; do :; done' already does that
--
Oğuz
Hi my name is Muhammed,
I wanted to ask why there isn't an option for wait that will take no jobspec or
pid but fail if any of the backgrounded processes fail.
This kind of functionality does not seem intuitive.
When waiting for a specific pid, wait will return the exit code of that
process. Maki