#! /bin/csh -f
# No data file

# unTarScript <dir>  <program file> 
#             <dir> is the directory containing the assignment submissions
#             <program file> is the name of data file 
# for example:  unTarScript Students camera.tar.gz
# where:  Students is one directory up, where all the students' directories are
#



if ($#argv < 2) then
   echo ""
   echo "unTarScript <directory> <program file>"
   echo ""
   exit
endif

cd $1
   set class = *
   foreach student ($class)
      if (-d $student) then
         cd $student
         echo -n "   uncompressing program for $student..."
         echo "--- results for $student ---" 
         if ($#argv > 1) then
            set last = $#argv
            set xfile = $2 
	    		if (-f $xfile) then
	        		bash -c "tar xzvf $xfile"
	    		else
	       		echo " *********  file not found:" >> $argv[$#argv]
          	endif
         	echo " " >> $argv[$#argv]
      	endif
      	echo "done"
      	cd ..
      endif
end

