#!/bin/csh -f

set whoami = $0
set whoami = $whoami:t

if ($#argv == 0) then
   echo "Usage: $whoami files ..."
   echo "  file should be compressed files whose names end with .taz."
   echo "  They are converted to gzipped files ending with .tgz."   
   exit 1
endif

set files = ($argv)

foreach i ($files)
   set r = $i:r
   set e = $i:e
   if ("$e" == "taz") then
      ls -l $r.taz
      mv $r.taz $r.Z
      uncompress $r
      gzip $r
      mv $r.z $r.tgz
      ls -l $r.tgz
   else
      echo "${whoami}: $i must end with .taz; skipping"
   endif
end   
