How do you handle while(1) fork(); ?

Yoshiyuki Tanaka tana at ee.sophia.ac.jp
Mon Jul 23 19:27:49 AEST 1990


I often use the following script to kill processes by its names. It's
stupid (kills itself) and dangerous (kills any process which includes
the argument as its name), but it works to kill zombies if run a
couple of times. I advise not to use it as root.

#!/bin/sh -f
pid=`ps -e | egrep $1 | awk '{print $1}'` 
echo KILLING $pid
kill -9 $pid >/dev/null 2>&1

----------------------------------------------------------------------------
				Yoshiyuki Tanaka
				Sophia University, Tokyo Japan.
				Dept of Electrical & Electronic Enginerring
				Deiters Laboratory.
				Email: tana at bob.ee.sophia.ac.jp
----------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list