aboutsummaryrefslogtreecommitdiff
path: root/bin/stack
blob: 84192d3064298079b88dc12380c5f8ff78fb2f55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/Users/ethan/plan9port/bin/rc

if(~ $#* 0)
	pid=core
if not
	pid=$1
shift
if(! ~ $pid [0-9] [0-9]*[0-9] */core *.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 $*