3
0

signal3.tests 220 B

1234567891011121314151617
  1. #!/bin/sh
  2. $THIS_SH -c '
  3. hup() {
  4. echo "child got HUP"
  5. }
  6. trap hup HUP
  7. echo "child sleeps"
  8. sleep 1
  9. echo "child exits"
  10. ' &
  11. child=$!
  12. sleep 0.1 # let child install handler first
  13. kill -HUP $child
  14. wait
  15. echo "parent exits"