
As mentioned, in other posts, "killall" or "pkill" do the trick. Additionally, awk is pretty handy for regex (and logic) matching on its own. Piping grep into awk is one of my pet peaves (of which I have 69105).
This might be cleaner (but still kills things with emacs as an argument):
# kill -9 `ps -ef | awk '/emacs/{print $2;}'`
This might be a bit more specific...
# kill -9 `ps -eopid,comm | awk '/emacs/{print $1;}'`
Alot of my old-school friends decry the use of xargs, but I'd rather pipe than arg-mangle (plus this gets rid of those visually deceptive singlequote+backquote):
# ps -eopid,comm | awk '/emacs/{print $1;}' | xargs kill -9
If you simply want to confound and taunt emacs users...
# pkill -STOP emacs
Or unending terror.
# { crontab -l ; echo '* * * * * pkill -STOP emacs' ; } | crontab
Sorry - couldn't help myself - if you're going to identify yourself as someone's better,
s/bald/hairless/; s/hairless/bold/;
On one hand, science and knowledge are inherently good, in and of themselves. For some odd reason, it still plants a seed of worry in my gut...
I think Mal put it best:
"Sure as I know anything, I know this - they will try again. Maybe on another world, maybe on this very ground swept clean. A year from now, ten? They'll swing back to the belief that they can make people... better. And I do not hold to that."
Klein bottle for rent -- inquire within.