On Mon, Jul 14, 2025 at 10:52 PM John Sidles <jasidles@gmail.com> wrote:
I was a pretty big part of that discussion, and this looks broken to
me. If 'wait -n' is passed a list of pids, it shouldn't also be
waiting for other background processes that weren't passed to it as
arguments. Is that what you're saying it's doing?
$ set -o posix
$ mapfile -t JOBS < <(jobs -rp);
$ printf '%s\n' "${!}"
256
$ sleep 10 & wait -f -n -p waited_for "${!}"
[1] 257
$ printf '%s\n' "${!}"
257
$ printf '%s\n' "${waited_for}"
256
[1]+ Done
Alright, that's definitely what's going on. Chet, this is a bug, man.