blob: c9b456ae5da3ba45b0c335f0ba0291f2fdafb0f7 (
plain)
1
2
3
4
5
6
7
8
|
# An error in a trap action must not disable the trap, and `exit` in a trap
# still sets the shell's status.
printf '%s\n' "trap 'echo trap ran; \${x?boom}' USR1" 'kill -USR1 $$' \
'echo a1' 'kill -USR1 $$' 'echo a2' |
env PS1= PS2= "$TSH" -i 2>&1 | grep -v -e boom -e 'job control' -e '^$'
"$TSH" -c 'trap "exit 3" USR1; kill -USR1 $$; echo after' </dev/null
echo "status $?"
|