1 # $FreeBSD: head/bin/sh/tests/builtins/trap2.0 194517 2009-06-19 22:15:59Z jilles $
2 # This is really a test for outqstr(), which is readily accessible via trap.
7 trap -- "$teststring" USR1
9 if [ "$teststring" != "-" ] && [ -z "$traps" ]; then
10 # One possible reading of POSIX requires the above to return an
11 # empty string because backquote commands are executed in a
12 # subshell and subshells shall reset traps. However, an example
13 # in the normative description of the trap builtin shows the
14 # same usage as here, it is useful and our /bin/sh allows it.
15 echo '$(trap) is broken'
21 if [ "$traps" != "$traps2" ]; then
22 echo "Mismatch for '$teststring'"
30 runtest '"echo" $PATH'
31 runtest '\echo "$PATH"'
37 while [ $i -le 127 ]; do
38 c=$(printf \\"$(printf %o $i)")
39 if [ $i -lt 48 ] || [ $i -gt 57 ]; then