#!/bin/ksh
# allrm - Korn shell script from UVSI stored in: /home/uvadm/sf/util/
# allrm - script to remove all files from a directory
#       - use if no of files greater than allowed by UNIX shell (8192)
#         (when you get errmsg "arg list too long")
#       - also provides audit trail with file-counts
#
reply="n"
until [ "$reply" = "y" ]
  do echo "Are you sure you want to remove files from $1 ? y/n"
     read reply
  done
#
if [ -d "$1" ]; then :
else echo "usage: allrm directory"
     echo "       ==============="
     echo " - arg1 must be a directory"
exit 1; fi
x=0;
for i in $1/*
  { let x=x+1
    echo "removing file# $x - $i "
    rm -f $i
    #=======
  }
echo "total $x files removed from $1"
exit
#
