shithub: rc

ref: a5d881764e2f96d0fba934a023e0565282a5af9a
dir: /bin/lstk/

View raw version
#!/bin/rc
rfork n
print=()
if(~ $1 -p){
	print=1
	shift
}
if(~ $#* 0)
	p=Broken
if not{
	p=$1
	shift
}
ps -a | grep $p | grep -v 'grep '^$p
p=`{ps | awk -v 'P='^$p '$7 == P || $2 == P || $6 == P{ p=$2 } END{ print p }'}
if(~ $#p 0){
	echo no proc $p >[1=2]
	exit noproctohand
}
echo scroll >/mnt/wsys/wctl
if(! ~ $#print 0){
	echo lstk'()' | acid -lthread $p
	echo acid -lthread -lpool $* $p
}
if not{
	{echo lstk'()'; cat} | acid -lthread -lpool $* $p
}