[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wait on procsub in EXIT trap
From: |
Grisha Levit |
Subject: |
Re: wait on procsub in EXIT trap |
Date: |
Tue, 21 Mar 2023 15:53:59 -0400 |
On Tue, Mar 21, 2023 at 3:28 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> > 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)
>
> Because the procsub gets reaped before the terminating signal arrives.
Oh I see, thanks.
So to wait for a procsub after receiving a terminating signal, one
must do so in a trap for the signal itself and not in an EXIT trap.