exitcode_trap6.tests 247 B

1234567891011
  1. # "exit" in trap should not use last command's exitcode,
  2. # but exitcode on entering the trap.
  3. # Nested trap should not interfere with this.
  4. $THIS_SH -c '
  5. trap "echo INT" int
  6. trap "kill -int $$;exit" term
  7. kill $$ &
  8. (exit 42)
  9. wait
  10. '
  11. echo 42:$?