Skip to content
Commitpedia
Log in Join & edit

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.

Not checked by a trusted editor yet Last edited Outdated?

Edit history of ShellCheck: static analysis for shell scripts: 1 recorded edit
Edit history · 1 edit
Type
Repo
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Source
koalaman/shellcheck

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 GitHub

Shell 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.

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

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 · Cheat sheet · 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 · Cheat sheet · Linux, macOS, Windows Script Command-line tools · jq & JSON on the command line 15 Oct 2026
  • 0392 Install Visual Studio Code on Linux, macOS and Windows Install VS Code from Microsoft's packages, Homebrew or winget, get the code command working in the terminal, and add the extensions you… Beginner · Step by step · Linux, macOS, Windows Article Command-line tools · Installing languages & tools 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.

  1. Commitpedia +844 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?