See also https://mywiki.wooledge.org/BashGuide and https://github.com/denysdovhan/bash-handbook.
https://www.shellcheck.net/ is amazing to spot pitfalls.
See my list https://learnbyexample.github.io/curated_resources/linux_cli... for learning resources for CLI tools, scripting, etc.