If an EXIT trap is executed after receipt of a terminating signal,
waiting on a process substitution within the trap can fail:

$ (trap 'wait $!; echo $?' EXIT; : <(:); kill 0)
-bash: wait: pid 83694 is not a child of this shell
127

Interestingly, if an external command or a subshell is executed after
the process substitution is started but prior to receipt of the
signal, the `wait' works fine:

$ (trap 'wait $!; echo $?' EXIT; : <(:); (:); kill 0)
0

Reply via email to