Shell Programming Best Practices
My Qualifications Since this is my own blog I’m usually happy to avoid reminding you of how qualified I am. In this case it is easy to note that: I spent a dozen years teaching shell scripting on UNIX and Linux with materials that I wrote the majority of. The students were surprised and happy to have a teacher that had real industry experience. I’ve done 46+ code reviews for bash on Code Review StackExchange over the last decade. I’ve been a fan of bash and a detractor for csh and ksh for 30+ years. Terminology note For purposes of this article I’m going to talk about the “shell” referring to various shell implementations which traditionally end in “sh”. This excludes scripting languages such as Perl and Python. I’m not trying to say anything bad about Python here. There’s plenty of that already on the Internet. The most popular shells these days are bash, zsh, and fish. Most of what I’m going to say could apply to any of them, but some things will be specific to the Bourne Shell (/bin/sh) and compatible shells such as bash and ksh. ...