Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!husc6!rice!sun-spots-request From: dupuy@cs.columbia.edu Newsgroups: comp.sys.sun Subject: Output from "ac" runs together Keywords: SunOS Message-ID: <4099@kalliope.rice.edu> Date: 20 Jun 89 22:56:52 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 22 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 48, message 12 of 19 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