Catch quoting and variable expansion bugs in automation scripts before they run in production.
Integrate into CI/CD pipelines to automatically reject shell scripts with warnings.
Get real-time feedback on shell script errors while editing in VS Code, Vim, or Emacs.
Learn common shell scripting pitfalls by reading ShellCheck's explanations for each warning.
ShellCheck is a static analysis tool for shell scripts, which means it reads your bash or sh script files and points out potential problems without actually running the code. Writing shell scripts is notoriously error-prone because the language has many subtle traps around quoting, variable expansion, and command substitution that can cause scripts to fail silently or behave unexpectedly on inputs the author did not anticipate. ShellCheck exists to catch these issues automatically before they cause problems in production. The tool works by parsing your shell script and applying a large set of rules derived from common shell scripting mistakes. It covers three levels of issues: syntax errors that beginners frequently make and that cause cryptic error messages, semantic problems that intermediate users encounter where the script runs but behaves counter-intuitively, and subtle edge cases and portability pitfalls that can trip up experienced developers. For each finding, ShellCheck provides a warning with a clear explanation and often a suggestion for how to fix it. You can try it instantly in a browser at shellcheck.net, run it from the command line, integrate it with editors like VS Code, Vim, and Emacs for inline highlighting, or add it to a CI pipeline to automatically fail builds that contain shell script warnings. You would use ShellCheck any time you write or maintain shell scripts, particularly automation scripts, build scripts, or deployment tooling where a subtle quoting bug could have serious consequences. It is also commonly added to CI/CD pipelines as a gating check to prevent problematic shell code from being merged. ShellCheck is written in Haskell and distributed as a pre-compiled binary for Linux, macOS, and Windows. It is available through most system package managers and can also be run as a Docker container. The project is licensed under GPLv3.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.