signal8.tests 331 B

123456789101112131415161718
  1. "$THIS_SH" -c '
  2. exit_func() {
  3. echo "Removing traps"
  4. trap - EXIT TERM INT
  5. echo "End of exit_func"
  6. }
  7. set -e
  8. trap exit_func EXIT TERM INT
  9. sleep 2
  10. exit 77
  11. ' &
  12. sleep 1
  13. # BUG: ash kills -PGRP, but in non-interactive shell we do not create pgrps!
  14. # In this case, bash kills by PID, not PGRP.
  15. kill -TERM %1
  16. wait
  17. echo Done: $?