A reader writes in with the following note:
I’ve just picked up your book Wicked Cool Shell Scripts, and there are a lot of nifty things in
it. I too have accumulated a lot of things generally in small scripts
or more frequently in bourne/bash functions. I was particularly tickled
to see a lot of very similar code, one such that jumped out at me was
your gmk function in one script (I called mine kmg).Would you be interested in some constructive criticism?
In script #52 Killing Processes by Name, I think that instead of:
awk “/ $1$/{ print \$2 }”
you might consider using
awk “$NF==”$1″ { print \$2 }”That way, you’re not dependent on whitespace.