#!/bin/csh -f # # Usage: grade # source $HOME/bin/class/SETUP echo -n " enter homework set number " set NUM = $< if !( -f $DIR/homeworks/homework$NUM ) then echo "homework$NUM has not been assigned yet." exit(-1) endif set ASSIGN = (`grep FILES $DIR/homeworks/homework$NUM`) shift ASSIGN set AFSID = `ls $DIR/assignments` echo -n "Send waring E-mail to all who are deficient? (y/n) " if ( $< != 'y' ) exit foreach STUDENT ($AFSID) if ( $STUDENT == $INSTRUCTOR ) continue cd "$DIR/assignments/$STUDENT/assignment$NUM" @ p = 0 set HWS foreach FILE ($ASSIGN) if !( -f $FILE ) then @ p++ set HWS = ( $HWS $FILE ) endif end if ( $p > 0 ) then echo " *****This is an automatically generated E-mail*****\ Your homework$NUM is not complete if you receive this\ E-mail. The following files:\ $HWS \ are not received as of the `date`. \ Contact your instructor if there is a problem.\ \ -- Bei Hu" | mailx "$STUDENT""@nd.edu" endif end