Top for AIX
Posted in 1995
Manoj Schroff — — source: Informix-list mailing list archive (1991-1998)
To the requestor of the top prog, Below is a simple shell script that does the trick. #---------START------------------------------------- #Take out kproc if you want the kernel processes included. ps uax|egrep -v "defunct|COMMAND|kproc"|sort -r +2|awk '{ l[1] = "USER" l[2] = "PID" l[3] = "%CPU" l[4] = "%MEM" l[7] = "COMMAND" split($0,z) idx=10 while(z[++idx]!='\\0') l[8] = sprintf("%s %s",l[8], z[idx]) if(NR==1) printf "%8s %6s %4s %4s %s\\n\\n", l[1], l[2], l[3], l[4], l[7] if(NR==12) exit printf "%8s %6s %4s %4s %s\\n", $1, $2, $3, $4, l[8] l[8]="" }'|more #----------END--------------------------------------