taccept process names - 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 dd6c037b72b0988ed9d55fd89af30b10ca9999ea
 (DIR) parent 1dc6e083c15e1580b02d30aa349821fe98fcf989
 (HTM) Author: rsc <devnull@localhost>
       Date:   Mon, 26 Jun 2006 00:02:19 +0000
       
       accept process names
       
       Diffstat:
         M bin/stack                           |      13 ++++++++++++-
       
       1 file changed, 12 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/bin/stack b/bin/stack
       t@@ -1,3 +1,14 @@
        #!/usr/local/plan9/bin/rc
        
       -echo '$c' | 9 db -q $*
       +pid=$1
       +shift
       +if(! ~ $pid [0-9] [0-9]*[0-9] */core *.core core.* */core.*){
       +        name=$pid
       +        pid=`{psu|awk '$NF=="'$name'" {print $2}'}
       +        if(~ $#pid 0){
       +                echo 'stack: no process '$name
       +                exit none
       +        }
       +}
       +for(p in $pid)
       +        echo '$c' | 9 db -q $p $*