Re: trap EXIT in piped subshell not triggered during wait

2013-04-15 Thread Chet Ramey
On 4/15/13 3:40 AM, Andreas Schwab wrote: > Is it correct that the EXIT trap is not executed if you let this run > through? I think the EXIT trap should be executed. I'll take a look at it. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita

Re: trap EXIT in piped subshell not triggered during wait

2013-04-15 Thread Andreas Schwab
Chet Ramey writes: > On 4/13/13 1:35 AM, Ilya Basin wrote: >> Hi! >> I've got strange behavior. Here's my script: >> >> #!/bin/bash >> { >> trap ' >> echo "in trap EXIT">&2 >> ' EXIT >> sleep 4 & >> echo 'sleep 2'>&2 >> sleep 2 >>

Re: trap EXIT in piped subshell not triggered during wait

2013-04-14 Thread Chet Ramey
On 4/13/13 1:35 AM, Ilya Basin wrote: > Hi! > I've got strange behavior. Here's my script: > > #!/bin/bash > { > trap ' > echo "in trap EXIT">&2 > ' EXIT > sleep 4 & > echo 'sleep 2'>&2 > sleep 2 > echo 'wait $!'>&2 > wait

trap EXIT in piped subshell not triggered during wait

2013-04-12 Thread Ilya Basin
Hi! I've got strange behavior. Here's my script: #!/bin/bash { trap ' echo "in trap EXIT">&2 ' EXIT sleep 4 & echo 'sleep 2'>&2 sleep 2 echo 'wait $!'>&2 wait $! echo 'exit'>&2 exit } | cat If I press