1#!/bin/sh23cleanup()4{5 rm -f test.txt6 kill -KILL $pid 2>/dev/null7 if test $1 -ne 08 then9 kill -KILL $$10 fi11}1213rm -f file.txt14trap 'cleanup 0' EXIT15trap 'cleanup 1' INT TERM HUP1617$EXEC scc make -nf - test.txt <<'EOF' &18test.txt:19 @+touch $@20 +@while : ; do sleep 1 ; done21EOF22pid=$!2324sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null &25timer=$!2627while :28do29 if test -f test.txt30 then31 kill $pid32 wait $pid33 kill $timer34 break35 fi36done3738test -f test.txt