#!/bin/csh -f
#
# clean the /mit/olc-stock/stock_answers  directory.  
# Check for twiddle files, deleted
# files, and fix permissions to be world-readable
#
# tompalka, 6aug92
# fixed stock answer path to point to the AFS readable volume
# location instead of /mit/olc-stock/stock_answers
#
# tompalka, 28jun91
# added a feature -- update the klook tree
# every time this script is run.  That's at
# the end.
#
# tompalka, 26apr91
# general modifications
#

alias find /usr/bin/find

# set dir = "/mit/olc-stock/stock_answers/"
set dir="/afs/.athena.mit.edu/astaff/reference/olc_stock-answers/stock_answers"

echo "finding twiddle files"
find ${dir} \( -name "*~" -o -name ".*~" \) -print -exec rm {} \;

echo "finding deleted files"
find ${dir} \( -name '.#*' -o -name '#*' \) -print -exec rm {} \;

# 20 Dec 92: Took these two lines out; useless for AFS, IMHO.  (kms)
# echo "fixing file permissions"
# find ${dir} -type f \! -perm 664 -print -exec chmod 664 {} \;

# echo "fixing directory permissions"
# find ${dir} -type d \! -perm 775 -print -exec chmod 775 {} \;

# echo "re-building the klook tree"
# attach -q eolcdev
# /mit/eolcdev/@sys/gettree >& /dev/null

echo "done."

