TIL about https://www.shellcheck.net, an open-source tool that can find bugs in your shellscripts!

… it certainly finds bugs in *my* shellscripts. /o\ #bangbangcon

ShellCheck – shell script analysis tool

ShellCheck finds bugs in your shell scripts

@blinry should be the minimal check on all your shellscripts :-)
@haploc @blinry Yes, this. #BashScripting is unsafe by default, though, so you really shouldn’t be doing anything terribly complicated in it unless you really can’t depend on another language or a C compiler being available in all cases. If you need to use Bash, you should follow a rigorous set of best practices and use Shellcheck to help enforce them. Here’s a good starting set of best practices - perhaps some day I’ll get some time to write mine down. https://bertvv.github.io/cheat-sheets/Bash.html
Bash best practices

Cheat sheets for various stuff

cheat-sheets