]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/trap4.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / trap4.0
1 # $FreeBSD$
2
3 T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
4 trap 'rm -rf $T' 0
5 cd $T || exit 3
6 mkfifo fifo1
7
8 v=$(
9 exec 3>&1
10 : <fifo1 &
11 {
12 wait $!
13 trap 'trap "" PIPE; echo trapped >&3 2>/dev/null' PIPE
14 echo x 2>/dev/null
15 } >fifo1
16 )
17 test "$v" = trapped