On Tue, Jul 15, 2025 at 8:22 AM Zachary Santer <zsan...@gmail.com> wrote:
>
> I am having a heck of a time trying to duplicate this
> behavior any other way.

I'm betting this is some kind of bash-internal race condition. Does
seem specific to procsub pids in interactive mode, though.
zsant@Zack2021HPPavilion MSYS ~/repos/bash
$ ./bash ~/random/wait-n-and-procsub-interactive
+ : 'BASH_VERSION=5.3.0(1)-maint'
+ sleep 2
+ : 'pid 113'
+ : /dev/fd/63
+ : 'pid 114'
++ sleep 3
+ sleep 5
+ : 'pid 115'
+ sleep 4
+ wait -n -p waited_for -- 115
+ : waited_for=115
+ : SECONDS=5
+ set +x

zsant@Zack2021HPPavilion MSYS ~/repos/bash
$ ./bash -i ~/random/wait-n-and-procsub-interactive
+ : 'BASH_VERSION=5.3.0(1)-maint'
+ sleep 2
+ : 'pid 118'
+ : /dev/fd/63
++ sleep 3
+ : 'pid 119'
+ : 'pid 120'
+ sleep 4
+ sleep 5
+ wait -n -p waited_for -- 120
+ : waited_for=119
+ : SECONDS=4
+ set +x

Attachment: wait-n-and-procsub-interactive
Description: Binary data

Reply via email to