Advanced Bash-Scripting Guide (2014)
The best guide to using Bash is to read the manual (<a href="https://linux.die.net/man/1/bash" rel="nofollow">https://linux.die.net/man/1/bash</a>).<p>Nobody who has ever used Bash has read the whole manual. It is actually good and useful, please read it. Yes, it is very big. But you will be using this shell for the rest of your life (even if you use Zsh, you will end up using other people's Bash scripts). Consider it an investment in your future.<p>...and now that I say that - try to restrict shell scripts to POSIX semantics (<a href="https://betterprogramming.pub/24-bashism-to-avoid-for-posix-compliant-shell-scripts-8e7c09e0f49a" rel="nofollow">https://betterprogramming.pub/24-bashism-to-avoid-for-posix-...</a>). POSIX is very simple and most shells can run it. If you need a Bashism, try Bash v3 first so it works on a Mac without Homebrew. Simple is better/portabler than complex. If you need something Bash doesn't provide, use any language that the majority of your team knows well.<p>If you want to test a specific version of Bash, there's containers @ <a href="https://hub.docker.com/_/bash" rel="nofollow">https://hub.docker.com/_/bash</a> (Macs use v3.2.57). Test POSIX scripts with <i>`bash --posix`</i>. Definitely use Shellcheck.