1# $FreeBSD: head/tools/regression/bin/sh/execution/redir2.0 199953 2009-11-29 22:33:59Z jilles $ 2trap ': $((brokenpipe+=1))' pipe
| 1# $FreeBSD: head/tools/regression/bin/sh/execution/redir2.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 11{ 12 { 13 exec sh -c 'exec <fifo1; read dummy' 14 } 7<&- # fifo2 should be kept open, but not passed to programs 15 true 16} 7<fifo2 & 17 18exec 4>fifo2 19exec 3>fifo1
| 3 4P=${TMPDIR:-/tmp} 5cd $P 6T=$(mktemp -d sh-test.XXXXXX) 7cd $T 8 9brokenpipe=0 10mkfifo fifo1 fifo2 11{ 12 { 13 exec sh -c 'exec <fifo1; read dummy' 14 } 7<&- # fifo2 should be kept open, but not passed to programs 15 true 16} 7<fifo2 & 17 18exec 4>fifo2 19exec 3>fifo1
|
20echo dummy >&4
| 20echo dummy >&4 2>/dev/null
|
21if [ $brokenpipe -eq 1 ]; then 22 : ${rc:=0} 23fi 24echo dummy >&3 25wait 26 27rm fifo1 fifo2 28rmdir ${P}/${T} 29exit ${rc:-3}
| 21if [ $brokenpipe -eq 1 ]; then 22 : ${rc:=0} 23fi 24echo dummy >&3 25wait 26 27rm fifo1 fifo2 28rmdir ${P}/${T} 29exit ${rc:-3}
|