If you’re interested in writing safe shell scripts then check out shellcheck: https://github.com/koalaman/shellcheck If you’re interested I’ve written a git hook for it that runs a check when you git commit: https://github.com/alblue/scripts/blob/main/shellcheck-pre-c... You should also check out her Google shell script style guide: https://google.github.io/styleguide/shellguide.html
Built-in autofixes and direct links to extensive documentation on each rule, with easy to grasp examples. It's just awesome.
[1]: https://marketplace.visualstudio.com/items?itemName=timonwon...