As a developer my job does not involve day to day shell scripting. It comes up occasionally and due to this I face a problem now where I forget the syntax and will have to look it up again which takes a long time. I want to improve on this and would like to be fluent and for this I need to script on a regular basis.<p>I would like to know how people of HN keep in touch with scripting on a regular basis as a part of your job and what are the practices that you follow.
I'd say check out the work of William Shotts at <a href="https://linuxcommand.org/" rel="nofollow noreferrer">https://linuxcommand.org/</a> His book, "The Linux Command Line" is free for downloading, and there are lots of references to style guides, good practices, and bash templates in the book.<p>There is also a shorter, HTML version at the same site: <a href="https://linuxcommand.org/lc3_learning_the_shell.php" rel="nofollow noreferrer">https://linuxcommand.org/lc3_learning_the_shell.php</a><p>I'm trying to get a little proficiency in all this, and just yesterday I went through the "Further Reading" sections at the end of each chapter, and captured all the likely URLs for further investigation.<p>One that looks really good is Dylan Araps' "Pure Bash Bible" ( See <a href="https://github.com/dylanaraps/pure-bash-bible">https://github.com/dylanaraps/pure-bash-bible</a> ) Confession: I found a PDF copy at Libgen, but don't tell anyone. This and the Shotts book have also been thoroughly discussed on Hacker News in the past. (I.e., search on the two titles and you'll probably get all the opinions that you can stand, plus maybe some more hints.)<p>Bash is profoundly weird, but if/when you can make it work, it's slick.
I forgot to mention "shellcheck" at <a href="https://www.shellcheck.net/" rel="nofollow noreferrer">https://www.shellcheck.net/</a> and the explanation of its error codes at <a href="https://www.shellcheck.net/wiki/" rel="nofollow noreferrer">https://www.shellcheck.net/wiki/</a><p>This is also referenced by Shotts, and has been discussed on Hacker News -- not to be missed.
Don't. My rule is if it's more then 3 lines or more complex than simple commmand call,
it'll be written in Python. It will be easier to read for everyone around and avoid all the shell footguns.