1 2T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` 3trap 'rm -rf $T' 0 4cd $T || exit 3 5mkfifo fifo1 6# Use a trap, not the default action, since the shell may catch SIGINT and 7# therefore its processing may be delayed. 8{ set -C; trap 'exit 5' TERM; read dummy <fifo1; exit 4; } & 9exec 3>fifo1 10kill -INT "$!" 11kill -TERM "$!" 12exec 3>&- 13wait "$!" 14r=$? 15[ "$r" = 5 ] 16