3
0

signal9.tests 418 B

123456789101112131415161718192021
  1. # Note: the inner script is a test which checks for a different bug
  2. # (ordering between INT handler and exit on "set -e"),
  3. # but so far I did not figure out how to simulate it non-interactively.
  4. "$THIS_SH" -c '
  5. exit_func() {
  6. echo "Removing traps"
  7. trap - EXIT TERM INT
  8. echo "End of exit_func"
  9. }
  10. set -e
  11. trap exit_func EXIT TERM INT
  12. sleep 2
  13. exit 77
  14. ' &
  15. child=$!
  16. sleep 1
  17. kill -TERM $child
  18. wait
  19. echo Done: $?