ShellCheck: static analysis for shell scripts
ShellCheck reads your bash or sh scripts and points out bugs, quoting mistakes and portability problems before you run them.
koalaman/shellcheck
- Stars
- 40.2k
- Forks
- 2k
- Language
- Haskell
- Licence
- GPL-3.0
- Last push
- 14 Oct 2026
On GitHub: ShellCheck, a static analysis tool for shell scripts
Open on GitHubShell scripts fail in subtle ways: unquoted variables split on spaces, cd fails silently, a [ $x = y ] breaks when x is empty. ShellCheck is a linter that knows hundreds of these traps. Run shellcheck myscript.sh and it prints each problem with the line, an explanation and a code such as SC2086. Every code has a wiki page explaining the issue and the fix.
It is written in Haskell and available in most package managers, and there is a web version at shellcheck.net where you can paste a script. Editor plugins for VS Code, Vim and others show warnings as you type, and it is easy to add to CI so scripts are checked on every pull request.
When a warning does not apply, you can silence it for one line with a comment directive such as # shellcheck disable=SC2086 on the line above. Use that sparingly: most warnings point at real bugs.
See also
- 0057 Shell cheat sheet: everyday commands A quick reference for moving around, managing files, viewing and searching text, checking processes and disk space in bash and zsh, with… Beginner · Reference · Linux, macOS Article Basics · Command-line tools 15 Oct 2026
- 0076 jq recipes: 23 one-liners for JSON on the command line A runnable collection of jq filters for everyday JSON work: pick fields, filter with select, reshape, sort, count, group, pass shell variables,… Intermediate · Reference · Linux, macOS, Windows Script Command-line tools · jq & JSON on the command line 15 Oct 2026
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- commitpedia-admin +844 chars