Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions spec/builtin-trap.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ trap | cat
bye
## END

#### ignored signals are active inside subshells
trap '' USR1
subshell_result=$(
trap '' USR2
trap - USR2
trap
)

# NOT a subshell
trap > traps.txt
shell_result=$(cat traps.txt)

if test "$shell_result" = "$subshell_result"; then
echo ok
fi

## STDOUT:
ok
## END

#### trap accepts/ignores --
trap -- 'echo hi' EXIT
Expand Down
Loading