]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/trap5.0
shell_cmds-203.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / trap5.0
1 # $FreeBSD: head/bin/sh/tests/builtins/trap5.0 217461 2011-01-15 21:09:00Z jilles $
2
3 set -e
4 trap - USR1
5 initial=$(trap)
6 trap -- -l USR1
7 added=$(trap)
8 [ -n "$added" ]
9 trap - USR1
10 second=$(trap)
11 [ "$initial" = "$second" ]
12 eval "$added"
13 added2=$(trap)
14 added3=$(trap --)
15 [ "$added" = "$added2" ]
16 [ "$added2" = "$added3" ]
17 trap -- - USR1
18 third=$(trap)
19 [ "$initial" = "$third" ]