From fc165dcb3eb3f6d5994903ae7f9cb91c9f598cef Mon Sep 17 00:00:00 2001 From: rsc Date: Wed, 19 Oct 2005 03:15:30 +0000 Subject: Autoframework (Jeff Sickel) --- bin/ps | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'bin/ps') diff --git a/bin/ps b/bin/ps index 7a8cd4e4..d6f44d9b 100755 --- a/bin/ps +++ b/bin/ps @@ -64,9 +64,25 @@ function statestr(s, wchan) if(start ~ /..:..:../){ # drop :ss sub(/:..$/, "", start); } - printf("%-8s %11d %8s %8s %8dK %-8s %s\n", + sub(/[ ]+$/, "", cmd); + line[0+nline++] = sprintf("%s\001%d\001%s\001%s\001%dK\001%s\001%s", user, pid, start, cputime, mem, statestr(stat, wchan), cmd); } + +END{ + for(i=0; i max[j]) + max[j] = length(a[j]); + } + for(i=0; i