# This script runs the .ed scripts generated by mkscripts.sh
# and compares their output against the .r files, which contain
PATH
="/bin:/usr/bin:/usr/local/bin/:."
[ X
"$ED" = X
-o ! -x $ED ] && ED
="../ed"
[ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
# Run the *-err.ed scripts first, since these don't generate output;
# rename then to *-err.ed~; they exit with non-zero status
echo "*** The script $i~ exited abnormally ***"
# Run the remainding scripts; they exit with zero status
base
=`expr $i : '\([^.]*\)'`
# base=`echo $i | sed 's/\..*//'`
# base=`$ED - \!"echo \\\\$i" <<-EOF
if cmp -s $base.o
$base.r
; then :; else
echo "*** Output $base.o of script $i is incorrect ***"
echo "*** The script $i exited abnormally ***"
grep -h '\*\*\*' errs.o scripts.o