Shell Check
Use shellcheck to analyze shell scripts for syntax errors, semantic problems, and style issues.
Usage
To check a single script:
shellcheck script.sh
To check all shell scripts in the current directory:
shellcheck *.sh
To check scripts recursively:
find . -name '*.sh' -exec shellcheck {} +
Common Options
-e CODE— exclude a specific warning (e.g.shellcheck -e SC2086 script.sh)-s SHELL— specify the shell dialect (bash,sh,dash,ksh)-f FORMAT— output format (tty,json,gcc,diff)