Also check any sourced shell scripts

shellcheck

  • Shell script static analysis tool.
    Check shell scripts for errors, usage of deprecated/insecure features, and bad practices.
    More information: <https://www.shellcheck.net>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

shellcheck --checked-sourced {{path/to/script.sh}}

click the source code to copy install shellcheck on any operating system with command-not-found.com