#!/bin/csh cd /data2/WWW2/IVM/FITS if ($#argv == 0) then echo -n "Enter date (yyyymmdd): " set gdate = $< echo -n "Enter data disk top directory (scrn/ivm) : " set gdisk = $< else set gdate=$argv[1] shift set gdisk=$argv[1] endif set year = `echo $gdate | awk '{ print substr($1,0,4) }'` cd $year if (! -e $gdate) mkdir $gdate cd $gdate set fils = `rsh banana "ls /$gdisk/$gdate/IMGM*"` set fils=($fils `rsh banana "ls /$gdisk/$gdate/*.gif"`) set fils=($fils `rsh banana "ls /$gdisk/$gdate/rivm*"`) foreach afil ($fils) if (-e $afil:t) then echo $afil:t already here else echo Copying $afil:t if ($afil:e == "Z" || $afil:e == "gz" || $afil:e == "gif") then rcp -p banana:$afil . else rsh banana /usr/local/bin/gzip $afil rcp -p banana:$afil.gz . endif endif end set fils = `rsh banana "ls /$gdisk/$gdate/mosaic/IMGM*"` if ($#fils != 0) then if (! -e mosaic ) mkdir mosaic cd mosaic foreach afil ($fils) if (-e $afil:t) then echo $afil:t already here else echo Copying $afil:t if ($afil:e == "Z") then rcp -p banana:$afil . else rsh banana /usr/bin/compress $afil rcp -p banana:$afil.Z . endif endif end endif