Output from "ac" runs together

dupuy at cs.columbia.edu dupuy at cs.columbia.edu
Wed Jun 21 08:56:52 AEST 1989


No fix for ac(8) (or sa(8), same problems), but this is what I do to break
apart the fields:

echo "	user       connect"

/usr/etc/ac -p | awk '
NF == 1 { printf("\t%-8.8s %9.9s\n", substr($0, 2, 8), substr($0, 10)); }
NF == 2 { printf("\t%-8.8s %9.9s\n", $1, $2); }' | sort -nr +1

echo "	user   processes     cpu mins    i/o blocks      memory usage"

/usr/etc/sa -m 2>&1 | egrep -v '32767|65534' | awk '
NF == 4 { printf("\t%-8.8s %s\n", substr($0, 1, 8), substr($0, 9)); }
NF == 5 { printf("\t%-8.8s %s\n", $1, substr($0, 9)); }' \
 | sort -nr +2 -3 +4 -5 +3 -4 +1 -2

Together, these two make a very nice cpu usage and connect time summary.
If someone was very motivated, they could do a join(1) on the ac and sa
output, to get a single accounting entry, but it wouldn't fit in 80
characters anymore.

@alex



More information about the Comp.sys.sun mailing list