1#! /bin/sh 2 3if [ ! -f ../a.out ] 4then 5 echo Making executable 6 (cd .. ; make) || exit 0 7fi 8 9for i in *.awk 10do 11 echo === $i 12 OUT=${i%.awk}.OUT 13 OK=${i%.awk}.ok 14 OK2=${i%.awk}.ok2 15 IN=${i%.awk}.in 16 input= 17 if [ -f $IN ] 18 then 19 input=$IN 20 fi 21 22 ../a.out -f $i $input > $OUT 2>&1 23 if cmp -s $OK $OUT 24 then 25 rm -f $OUT 26 elif [ -f $OK2 ] && cmp -s $OK2 $OUT 27 then 28 rm -f $OUT 29 else 30 echo '++++ $i failed!' 31 fi 32done 33