1# $FreeBSD: head/tools/regression/bin/sh/execution/redir1.0 199953 2009-11-29 22:33:59Z jilles $ 2trap ': $((brokenpipe+=1))' pipe
| 1# $FreeBSD: head/tools/regression/bin/sh/execution/redir1.0 211408 2010-08-16 22:23:19Z jilles $ 2trap ': $((brokenpipe+=1))' PIPE
|
3 4P=${TMPDIR:-/tmp} 5cd $P 6T=$(mktemp -d sh-test.XXXXXX) 7cd $T 8 9brokenpipe=0 10mkfifo fifo1 fifo2 11read dummy >fifo2 <fifo1 & 12{ 13 exec 4>fifo2 14} 3<fifo2 # Formerly, sh would keep fd 3 and a duplicate of it open. 15echo dummy >fifo1 16if [ $brokenpipe -ne 0 ]; then 17 rc=3 18fi 19wait
| 3 4P=${TMPDIR:-/tmp} 5cd $P 6T=$(mktemp -d sh-test.XXXXXX) 7cd $T 8 9brokenpipe=0 10mkfifo fifo1 fifo2 11read dummy >fifo2 <fifo1 & 12{ 13 exec 4>fifo2 14} 3<fifo2 # Formerly, sh would keep fd 3 and a duplicate of it open. 15echo dummy >fifo1 16if [ $brokenpipe -ne 0 ]; then 17 rc=3 18fi 19wait
|
20echo dummy >&4
| 20echo dummy >&4 2>/dev/null
|
21if [ $brokenpipe -eq 1 ]; then 22 : ${rc:=0} 23fi 24 25rm fifo1 fifo2 26rmdir ${P}/${T} 27exit ${rc:-3}
| 21if [ $brokenpipe -eq 1 ]; then 22 : ${rc:=0} 23fi 24 25rm fifo1 fifo2 26rmdir ${P}/${T} 27exit ${rc:-3}
|