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 -- Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| HÃ¥rdgrim of Numenor "I do not agree with a word that you say, but I |---------------------------- will defend to the death your right to say it." | Where are we going, and --Evelyn Beatrice Hall paraphrasing Voltaire | what's with the handbasket?