Plan 9 from User Space's /usr/local/plan9/bin/kill

#!/bin/sh

sig=""
case "$1" in
-*)
	sig=" $1"
	shift
	;;
esac

for i
do
	psu | awk '$NF == "'"$i"'" || $2 == "'"$i"'" {printf("/bin/kill%s %d # %s\n", "'"$sig"'", $2, $0);}'
done

Space Glenda

Copyright © 2005 Lucent Technologies, Russ Cox, MIT.
See license for details.