#! /bin/ksh for file in *.tar.Z do echo one .tar.Z file is $file if test -d ${file%.tar.Z} then echo skip ${file%.tar.Z} else echo mkdir ... mkdir ${file%.tar.Z} echo cp ... `exec cp $file ${file%.tar.Z}` echo cd ... cd ${file%.tar.Z} echo uncompress ... uncompress $file echo tar ... tar -xf ${file%.Z} if test -f a.out then rm a.out else echo " " fi echo make ... make > ERROR 2>&1 if test -f a.out then echo "****************************" echo "****************************" ( ulimit -t 10; ulimit -f 6; a.out < ../input > output & wait) mailx teo@cs cs60@cs << ENDOFMAIL Your Program Compiled and created an a.out file Here is the list of all the files you created `exec ls -l` With the input file ... `exec cat ../input` It creates the output with Time limit 10 seconds and File Size limit of 6K ... `exec cat output` ENDOFMAIL cd ../ else echo "****************************" mailx teo@cs cs60@cs << ENDOFMORE Your program did not compile. This is what the compiler complains about ... `exec cat ERROR` Please fix it and turn in again ... These are the files you turned in `exec ls -l` Note that file ERROR is just a tempory file created by the system ENDOFMORE rm * cd ../ rmdir ${file%.tar.Z} mv $file ${file}Z fi fi done