Re: Trap does not work if a subshell wait(s) for job

2015-02-20 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/18/15 8:06 AM, Dr. Werner Fink wrote: > Hi, > > found due to a hang in the test suite of gnutls, after debugging I've > extract the example code > > launch_server () { sleep 100 & l=$!; trap "kill -15 $l" 15; echo $l; > wait $l; } > l

Trap does not work if a subshell wait(s) for job

2015-02-18 Thread Dr. Werner Fink
Hi, found due to a hang in the test suite of gnutls, after debugging I've extract the example code launch_server () { sleep 100 & l=$!; trap "kill -15 $l" 15; echo $l; wait $l; } launch_server & x=$! sleep 2 kill $x which does wait the full 100 seconds with bash 4.3 but with