[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trap does not work if a subshell wait(s) for job
From: |
Dr. Werner Fink |
Subject: |
Trap does not work if a subshell wait(s) for job |
Date: |
Wed, 18 Feb 2015 14:06:44 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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 the old bash 4.2
only 2 seconds.
Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
signature.asc
Description: Digital signature
- Trap does not work if a subshell wait(s) for job,
Dr. Werner Fink <=