Listing of the Script
E.4 Listing of the Script
#!/bin/sh
#######################################################################
#
# accounting_summary
#
#######################################################################
usage() {
echo "Usage : $sname [ -u -p -d [ -M | -H ] ] [ days ]"
}
help() {
usage
echo "\t-h\tThis help message"
echo "\t-p\t’Project’ is primary sort field (default)"
echo "\t-u\t’User’ is primary sort field"
echo "\t-M\tShow time in minutes rather than seconds"
echo "\t-H\tShow time in hours rather than seconds"
echo "\t-d\tDelete all ’not running’ accounting records after producing summary"
exit 0
}
#
# main
#
sname="accounting_summary"
OS=‘uname‘
if [ "$OS" = "Linux" ]; then
RMSPATH="/usr/bin"
elseif [ "$OS" = "OSF1" ]; then
RMSPATH="/usr/opt/rms/bin"
elseRMSPATH="/opt/rms/bin"
fi
fi
RMSGETTIME=${RMSPATH}/rmsgettime
RMSQUERY=${RMSPATH}/rmsquery
tmpfile="/tmp/accounting_summary_$$"
if [ -x /bin/gawk ]; then
AWK="/bin/gawk"
elseAWK="/usr/local/bin/gawk"
fi
primary="project"
delete=""
hours=""
minutes=""

Accounting Summary Script E-3