data/method/busybox/busybox-1.36.0/shell/hush_test/hush-misc/exitcode_trap3.tests

10 lines
204 B
Plaintext
Executable File

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