exitcode_trap3.tests 204 B

123456789
  1. # "return" in trap should not use last command's exitcode,
  2. # but exitcode on entering the trap.
  3. trap "echo TERM;return" term
  4. f() {
  5. (sleep 1; kill $$) &
  6. until (exit 42) do (exit 42); done
  7. }
  8. f
  9. echo 42:$?