plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

stack (300B)


      1 #!/usr/local/plan9/bin/rc
      2 
      3 if(~ $#* 0)
      4 	pid=core
      5 if not
      6 	pid=$1
      7 shift
      8 if(! ~ $pid [0-9] [0-9]*[0-9] */core *.core core.* */core.* core){
      9 	name=$pid
     10 	pid=`{psu|awk '$NF=="'$name'" {print $2}'}
     11 	if(~ $#pid 0){
     12 		echo 'stack: no process '$name
     13 		exit none
     14 	}
     15 }
     16 for(p in $pid)
     17 	echo '$c' | 9 db -q $p $*