set -e T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) trap 'rm -rf "$T"' 0 cd $T mkfifo fifo1 # Open fifo1 for writing and then read block on a dummy fifo { mkfifo fifo2; read dummy fifo1 & # Wait for the child to open fifo1 for writing exec 3