Compaq SC RMS Server User Manual


 
Listing of the Script
#
# parse the options
#
while [ $# -gt 0 ]; do
option=‘echo $1 | sed "s/ˆ-//"‘
if [ "$option" = "$1" ]; then
break
fi
if [ "$option" = "p" ]; then
primary="project"
elif [ "$option" = "u" ]; then
primary="user"
elif [ "$option" = "d" ]; then
delete="1"
elif [ "$option" = "M" ]; then
if [ "$hours" = "1" ]; then
echo "$sname: ERROR : -M and -H are mutually exclusive"
exit 1
fi
minutes="1"
elif [ "$option" = "H" ]; then
if [ "$minutes" = "1" ]; then
echo "$sname: ERROR : -M and -H are mutually exclusive"
exit 1
fi
hours="1"
elif [ "$option" = "h" ]; then
help
else
echo "$sname: ERROR : invalid option $1"
usage
exit 1
fi
shift
done
if [ $# -gt 0 ]; then
days=$1
shift
else
days=1
fi
if [ $# -gt 0 ]; then
usage
exit 1
fi
now=‘$RMSGETTIME‘
secsperday=‘expr 60 \* 60 \* 24‘
daysecs=‘expr $secsperday \* $days‘
E-4 Accounting Summary Script