Listing of the Script
printf ("Name Name Secs Secs Secs Sessions\n")
}
}
printdashes()
}
primary = $1
secondary = $2
for (i=1; i<=nvalues; i++) {
values[i] = 0
primvalues[i] = 0
}
recs = 0
primrecs = 0
printprim = 1
} else {
if ($2 != secondary) {
printsortfields()
printvals(values)
printf (" %6d\n", recs)
secondary = $2
for (i=1; i<=nvalues; i++) {
values[i] = 0
}
recs = 0
}
}
for (i=1; i<nvalues; i++) {
if (hours == 1) {
val = $(i+2) / 3600
} else {
if (minutes == 1) {
val = $(i+2) / 60
} else {
val = $(i+2)
}
}
values[i] = values[i] + val
primvalues[i] = primvalues[i] + val
grandvalues[i] = grandvalues[i] + val
}
recs++
primrecs++
grandrecs++
}
END {
printsortfields()
printvals(values)
printf (" %6d\n", recs)
printdashes()
printf ("Total %-10.10s ", primary)
printvals(primvalues)
Accounting Summary Script E-7