Disclaimer: You are looking at a post I wrote some time ago. The information and opinions contained within may be outdated and may differ from my current views. Please proceed accordingly.

Killing Mozilla When It Hangs

Apr 30, 2003 6:10 PM
Tags: bugs, linux, mozilla

update Bob informs me that I could just use killall -9 mozilla.

D'oh.

I often learn programming by starting with someone else's code and modifying or tinkering to suit my needs.

In an earlier post, I used this to kill Mozilla:

alias killmoz='pgrep moz | head -n1 | perl -e "while(<>) { chomp(\$_); print \$_ }" | xargs -0 kill -9'

It turns out that that can be done a lot more simply:

alias killmoz='pgrep moz | xargs kill -9'

According to the xargs man page, the -0 option is only used when "input filenames are terminated by a null character instead of by whitespace".

Whoops ... though I did learn some stuff in the course of making that mistake. :)

This blog is no longer active, and comments have been disabled.