Scroll to navigation

SHELLCHECK(1) General Commands Manual SHELLCHECK(1)

NAME

shellcheck - analyse shell scripts

SYNOPSIS

shellcheck [ -f format ] [ -e code ] [ -s shell ] files

DESCRIPTION

shellcheck syntactically analyzes shell scripts and points out typical issues. Among other things, it is able to spot wrong usage of unicode characters, non-matching parentheses, wrong spacing, usage of features unavailable to the selected shell, corner cases with respect to quoting, needlessly complex snippets and unused variables. The analysis does not actually execute any shell commands.

OPTIONS

-f format, --format format
Select the format used for printing diagnostics. Available formats are checkstyle (XML based format), gcc, json and and tty (colorful). The default format is tty.
-e code, --exclude code
Suppress emission of given diagnostic codes. Diagnostic codes consist of four decimal digits. To suppress multiple codes, the option can be given multiple times or codes can be separated using commas.
-s shell, --shell shell
Select shell dialect. Available shells are bash, ksh (Korn shell), sh (POSIX compatible), and zsh. If this option is not given, the dialect is guessed from the shebang. Defaults to bash.

SEE ALSO

bash(1), ksh(1), sh(1), zsh(1)

AUTHORS

shellcheck was written by Vidar Holen.
This manual page was written by Helmut Grohne for the Debian project (but may be used by others).
23 JUNE 2014