shellcheck Command Examples

Statically check shell scripts for errors, usage of deprecated/insecure features, and bad practices. More information: https://github.com/koalaman/shellcheck/wiki.

shellcheck {{path/to/script.sh}}

shellcheck {{[-s|--shell]}} {{sh|bash|dash|ksh}} {{path/to/script.sh}}

shellcheck {{[-e|--exclude]}} {{SC1009,SC1073,...}} {{path/to/script.sh}}

shellcheck {{[-a|--check-sourced]}} {{path/to/script.sh}}

shellcheck {{[-f|--format]}} {{tty|checkstyle|diff|gcc|json|json1|quiet}} {{path/to/script.sh}}

shellcheck {{[-o|--enable]}} {{add-default-case,avoid-nullary-conditions,...}} {{path/to/script.sh}}

shellcheck --list-optional

shellcheck {{[-S|--severity]}} {{error|warning|info|style}} {{path/to/script.sh}}