tshow the amount of memory in use instead of the amount of address space. work a little harder for wchans - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 33514167ed3bfd7d80c9a08c7c38e52a691d51b1
 (DIR) parent f9bca6a2a402eca55bcd8ea3f17d0051d7b5382e
 (HTM) Author: rsc <devnull@localhost>
       Date:   Tue,  4 Jan 2005 21:14:58 +0000
       
       show the amount of memory in use
       instead of the amount of address space.
       work a little harder for wchans
       
       Diffstat:
         M bin/ps                              |       6 +++---
       
       1 file changed, 3 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/bin/ps b/bin/ps
       t@@ -25,7 +25,7 @@ BEGIN{
        
        function statestr(s, wchan)
        {
       -        if(wchan != s && wchan != "?")
       +        if(wchan != s && wchan != "?" && wchan != "-")
                        return wchan;
                t = state[substr(s, 1, 1)];
                if(t == "")
       t@@ -71,11 +71,11 @@ function statestr(s, wchan)
        
        case "${SYSNAME:-`uname`}" in 
        SunOS)
       -        /bin/ps -aA -o 'user,pid,stime,time,vsz,s,s,args' | sed 1d |
       +        /bin/ps -aA -o 'user,pid,stime,time,rss,s,s,args' | sed 1d |
                        nawk -f /tmp/awk.xxx$$ | sort -n +1
                ;;
        *)
       -        /bin/ps -axww -o 'user,pid,start,time,vsz,stat,wchan,command' | sed 1d |
       +        /bin/ps -axww -o 'user,pid,start,time,rss,stat,wchan,command' | sed 1d |
                        awk -f /tmp/awk.xxx$$ | sort -n +1
                ;;
        esac