plan9port/bin/stack

15 lines
265 B
Text
Raw Normal View History

2005-01-23 22:56:33 +00:00
#!/usr/local/plan9/bin/rc
2006-06-26 00:02:19 +00:00
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 $*