Listing 7
#
# isonite.sh: Version 2.0 2/27/92 by Leor Zolman
# Tell whether an overnight job by a specific name exists
# usage:
# if isonite.sh name
# then ....
#
# returns true if it does exist.
#
SPOOLDIR=/usr/spool/onite/jobs
NPRIORITIES=7
[ $# -ne 1 ] && echo "usage: $0 <name>" && exit 1
priority=1
while [ $priority -le $NPRIORITIES ]
do
[ -r $SPOOLDIR/$1 ] && exit 0
priority=`expr $priority + 1`
done
exit 1
|