hush: implement "return NUM in trap sets $? after trap"
[oweals/busybox.git] / shell / hush_test / hush-misc / exitcode_trap3.tests
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:$?