This is actually a newbie error on solaris :-) ... killall does kill ALL ! same as HPUX, think AIX is the same. / lars Segerlund Lars Clausen wrote:
On Tue, 22 Apr 2003, Andreas Schweitzer wrote:
Hi,
I kept cosidering the alternatives, and apart from the UDS idea (not feasible), the incomplete "bye" command, there's also another option!
kill `ps -U <USER> | grep bm_srv12 | sed 's/^ *//g' | cut -d' ' -f1`
On OpenBSD and FreeBSD, this construct does return the PID indeed. I'm just not sure how portable that is in general.
Quite less portable is killall (which does not even exist on OpenBSD), but on FreeBSD it has an -u for user option. I.e. "killall -u andy bm_srv12" will do it, but only on FreeBSD :-(
Don't ever, *ever* consider killall portable. Under at least HPUX, killall silently ignores its arguments and kills all the processes it can get its murderous little hands on. A bad day to be root...
-Lars