#! /bin/sh
#
# Filename:  removedumps
#
# Author:  Br. David Carlson
#
# Date:  February 15, 2004
#
# Removes all core dumps from within /users.  Must be run by root
# (the system administrator).

TMP="./coredumps.$$"

/usr/bin/find /users -name "core.[0-9]*" -type f > $TMP

while read fname                
do                              
   str=`file "$fname" | grep 'core file'`
   if [ -n "$str" ]
   then
      rm -f "$fname"
   fi
done < $TMP

rm $TMP                                
exit 0

