This is just a silly script, of the variety that most of us probably have sitting around in somewhere $HOME
I have some very silly scripts hanging around. "killname.sh" dates from before I knew 'pkill' was a thing :)
Thanks to this reply, I just learned that 'pkill' is a thing! I've generally relied on killall - though it's not available on some platforms AFAIK.
To echo the larger point, I've written a bunch of similar scripts in my lifetime.
For a long time OS X didn't have `pkill`. I think it's there now with 10.8, but was missing for too many years.
I remember the one weird thing was that `killall` used to behave weirdly on commercial Unix. It would ignore its arguments and simply attempt to kill all processes. It's been a long time since I've logged into such a system, but it was then that I got used to typing `pkill`.
But does that make the author a bad person? Worthy of ridicule for having thrown it online? Of course not. This is just a silly script, of the variety that most of us probably have sitting around in somewhere $HOME. It's not worth getting worked up over.
The ultimate irony is, I wonder how the critics would feel about the code of sed and grep. Have they bothered to look? I myself do have these loud, exaggerated, critical attitudes towards code quality, but at some point I realized that most of the code I rely on every day is probably not up to my standards, and yet I still willingly rely on it. A younger self might have been tempted to re-write all of it, but I only have one lifetime to do such things and I'm already busy as it is. There is a time for rewrites on the basis of code quality, I would advocate for it where it is constructive or even simply satisfying, but at some point you have to admit that many (most?) times you will have to pass on this impulse.