`wait` triggers an infinite "pid is not a child of this shell" loop
when
used in an EXIT trap.
Repeat-By:
Run the following:
jobs=()
cleanup() {
kill -- "${jobs[@]}"
wait
}
trap cleanup EXIT
true & jobs+=($!)
true & jobs+=($!)
true & jobs+=($!)
true & jobs+=($!)
true & jobs+=($!)
Ocasionally bash loops at `wait` claiming some "pid is not a child of
this shell". (It doesn't happen if `kill` is not used.)