Cover V02, I02
Article
Listing 1
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7

mar93.tar


Listing 5: maxtab.sh -- Command file run by cron

:
######################################################
# maxtab.sh -
######################################################
# Steve Isaacson - Jan'93
# maxtab.sh - this is the maxtab control script which
# is run nightly by cron.  It cd's to the maxtab
# directory and looks for maxtab files.  mxfl is then
# called for each maxtab entry.

# location of maxtabs
maxtabdir=/usr/spool/cron/maxtabs

# location of mxfl program (or just make sure mxfl
# is in your PATH)
MXFLDIR=/usr/bin

cd $maxtabdir
for name in *
do
# if dir is empty, we'll just continue
test -f "$name" || continue

while read file maxlines
do
# skip comments, spaces, blank lines
case "$file" in
\#|\ |""|\#*) continue ;;
esac

# su and call mxfl to prune the specified file
/bin/su -c $name $MXFLDIR/mxfl $file $maxlines

done < $name

done
exit 0