#! /bin/sh echo "Hello ${USER} -- Hope you studied well\n" echo " " echo "I'm sending a message to brock@cs.unca.edu to say you picked up the exam" tempfile=/tmp/${USER}.$$ takedir=/usr/users/${USER}/csci/373/takehome rm -f ${tempfile} echo "${USER} has picked up the exam" >> ${tempfile} date >> ${tempfile} Mail brock@cs.unca.edu < ${tempfile} rm -f ${tempfile} echo " " if [ -d ${takedir} ] ; then echo "I see you already have a csci/373/takehome directory" else echo "Creating csci/373/takehome directory" mkdir -p ${takedir} chmod go-rx ${takedir} fi echo " " echo "Copying files to your csci/373/takedir directory" cd ${takedir} tar xfv /usr/local/csci/373/takehome.tar echo " " echo "Now I have to stick your user id into a couple of files" echo " " echo " Changing csci/373/takedir/index.html" mv ${takedir}/index.html ${takedir}/index.html.in sed -e "s/REPLACEME/${USER}/g" ${takedir}/index.html.in \ > ${takedir}/index.html rm ${takedir}/index.html.in echo " Changing csci/373/takedir/prob3/Makefile" mv ${takedir}/prob3/Makefile ${takedir}/prob3/Makefile.in sed -e "s/brock/${USER}/g" ${takedir}/prob3/Makefile.in \ > ${takedir}/prob3/Makefile rm ${takedir}/prob3/Makefile.in echo " " echo " " echo " " echo "OK. The files are in place" echo "Remember -- you need to finish by 5:50 PM on Tuesday" echo " " echo " " echo " " echo "Now connect to ${takedir} by typing" echo " cd ${takedir}" echo "And view the exam by reading index.html with your favorite browser." echo "That is, type" echo " netscape index.html -- or" echo " Mosaic index.html -- or" echo " lynx index.html -- if you're in a bad shape..."