shithub: rc

ref: f7e9f4873a050552f9d197269cb028f78f8f20d7
dir: /bin/die/

View raw version
#!/bin/rc
if(! ~ $#* 2){
	echo usage: $0 program parentpid >[1=2]
	exit usage
}
ps -n |\
	awk -v 'prg='$1 -v 'pid='$2 '
BEGIN{
	getline <("/proc/" pid "/noteid")
	nid = $1
}
$3 == nid && $8 == prg{
	print kill >("/proc/" $2 "/note")
}
'