xref: /freebsd/bin/sh/tests/builtins/trap4.0 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1
2T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
3trap 'rm -rf $T' 0
4cd $T || exit 3
5mkfifo fifo1
6
7v=$(
8	exec 3>&1
9	: <fifo1 &
10	{
11		wait $!
12		trap 'trap "" PIPE; echo trapped >&3 2>/dev/null' PIPE
13		echo x 2>/dev/null
14	} >fifo1
15)
16test "$v" = trapped
17