#!/bin/bash # #W.K. Ziemer 2001 # precreate a problem set for every course, staggered by one hour. # if [ $# -eq 0 ] ; then echo "syntax is PrecreateAll.sh course-prefix setDefinitionFile (optional: time to start)"; echo "example: PrecreateAll.sh ma112_ set1.def "; echo " this will precreate set1 for all courses of the name ma112_ starting now"; exit 0; fi; I=0; if [ -n $3 ] ;then TIME=$3; else TIME="now"; fi; echo "First job to start $TIME"; TMPPATH="/var/www/webwork/courses/${1}*"; for NAME in $TMPPATH; do COURSE=`echo "$NAME" | sed s#/var/www/webwork/courses/##`; echo "nice l2hPrecreateSet.pl $COURSE $2 " > data.$I ; at -f data.$I $TIME +"$I" hour ; I=`expr "$I" "+" 1`; done