Listing of the Script
printf ("\t %-8.8s ", secondary)
}
}
function printdashes() {
printf
("---------------------------------------------------------------------\
----\n")
}
function printvals(vals, i) {
for (i=1; i<=nvalues; i++) {
if (hours == 1 || minutes == 1) {
printf (" %13.2f", vals[i])
} else {
printf (" %13.0f", vals[i])
}
}
}
NF > 0 {
if ($1 != primary) {
if (primary != "") {
printsortfields()
printvals(values)
printf (" %6d\n", recs)
printdashes()
printf ("Total %-10.10s ", primary)
printvals(primvalues)
printf (" %6d\n", primrecs)
printdashes()
} else {
datestr = strftime("%H:%M %a %d %b %Y")
titlestr = sprintf ("Accounting Summary of Machine %s at %s", \
machine, datestr)
print titlestr
if (days > 1) {
daystr = sprintf ("%d Days",days)
} else {
daystr = "Day"
}
printf ("Usage by %s/%s For Previous %s\n", primtitle, sectitle, daystr)
printf ("\n")
printf ("%-10.10s %-8.8s CPU User Sys Number\n", \
primtitle, sectitle)
if (hours == 1) {
printf ("Name Name Hours Hours Hours Sessions\n")
} else {
if (minutes == 1) {
printf ("Name Name Mins Mins Mins Sessions\n")
} else {
E-6 Accounting Summary Script