1#!/bin/sh23file=${1?' empty input file'}4err=/tmp/$$.err5chk=/tmp/$$.chk67trap 'rm -f a.out *.o $chk $err; exit' EXIT HUP INT TERM8ulimit -c 09rm -f test.log1011while read i state12do13 echo $i >> test.log14 state=${state:-""}1516 (SCCPREFIX=$SCCPREFIX $CC $CFLAGS -w -c $i) 2> $err17 (echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i) >/dev/null 2>&118 (diff -u $chk $err >> test.log && printf '[PASS]' || printf '[FAIL]'19 printf "\t%s\t%s\n" $i $state) | tee -a test.log20 rm -f *.o21done < $file