#               arlrisc:/archive/smutil/etasmt2d      
#           copy semi-monthly file from tape to disc   
#           print file inventory  

 # semi-monthly period
 echo
 echo "days 01 to 15  (1)"
 echo "days 16 to end (2)"
 read ism

 # device
 tdev=rmt0

 # rewind
 mt -f /dev/$tdev rewind
 
 # skip tape files before reading 
 echo
 echo "number of tape files to skip before reading"
 read fskip
 if [ $fskip -gt 0 ]; then
   echo
   echo "skipping $fskip tape files"
   mt -f /dev/$tdev.1 fsf $fskip
 fi

 # remove old disc file
 if [ -f AVN* ]; then rm AVN*; fi
 if [ -f ETA* ]; then rm ETA*; fi

 # copy tape file to disc file 
 echo
 echo "copying tape file to disc file"
 tar -xvf /dev/$tdev.1 ETANH.SM$ism

 # inventory disc file 
 echo
 echo "inventorying disc file" 
 etasminv.e << eof
$ism
eof

 # print inventory file
 echo
 echo "semi-monthly inventory file printed on laserjet"
 lj SMINV

 # rewind
 echo
 echo "rewinding tape"
 mt -f /dev/$tdev rewind
 echo

