A static analysis tool for shell scripts that finds bugs and suggests improvements
ShellCheck is a static analysis tool that helps developers write better bash and shell scripts by identifying common errors, style issues, and potential pitfalls. It analyzes shell scripts and provides warnings and suggestions for typical beginner syntax issues that cause cryptic error messages, intermediate-level semantic problems that lead to unexpected behavior, and subtle corner cases that could cause advanced users' scripts to fail in certain circumstances.
The tool is designed for developers at all skill levels who work with shell scripts. It can catch quoting issues, conditional statement problems, misused commands, portability concerns, and various other scripting mistakes before they cause runtime errors. ShellCheck integrates seamlessly into development workflows through multiple interfaces: a web-based version at shellcheck.net, command-line usage, editor plugins for Vim, Emacs, VS Code and others, and CI/CD pipeline integration.
ShellCheck is particularly valuable for DevOps engineers, system administrators, and developers who rely on shell scripts for automation, build processes, or system management. The tool supports various output formats including JSON, XML, and GCC-compatible warnings, making it easy to integrate into existing toolchains and automated testing suites.
# via Homebrew
brew install shellcheck
# via APT
sudo apt install shellcheck
# via Cabal
cabal update && cabal install ShellCheck


