]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - bin/sh/tests/builtins/trap4.0
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / bin / 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