#!/usr/bin/env bash # Simple shell script to test programs gsys1..gsys6 # Each program is run as: gsysI out.N.gsysI for prog in 1 2 3 4 5 6 do let errors=0 echo "Testing gsys$prog..." for infile in in.* do outfile=$(echo $infile | sed -e "s/in/out/") echo " $infile --> $outfile.gsys$prog" gsys$prog <$infile >$outfile.gsys$prog 2>&1 if [ -e $outfile ] then if diff -q -b -B $outfile $outfile.gsys$prog then : # echo " no error detected" else # echo "INCREMENTING ERRORS because of $outfile.gsys$prog..." let errors=errors+1 fi else echo " Error: cannot find sample output: $outfile" fi done echo "... $errors errors detected in gsys$prog." echo "" done