ShellCheck Error Decoder
Decode ShellCheck error codes SC1xxx-SC3xxx into plain-English explanations with before/after fix examples.
How to use the ShellCheck Error Decoder
- 1Paste a ShellCheck error code (e.g., SC2086) into the search field, or type the four-digit number directly.
- 2The tool displays the full rule name, a plain-English explanation of what is wrong, and why it matters.
- 3Review the before/after code example to see exactly what change ShellCheck expects.
- 4Click "Copy Fix" to get the corrected line for your script, then run ShellCheck again to confirm the warning is resolved.
Run this script on a real Linux server
Get $200 free credit — DigitalOcean
Get $200 Free →Affiliate link · we earn a commission
Frequently Asked Questions
What is ShellCheck?
ShellCheck is an open-source static analysis tool for bash and sh scripts. It detects common mistakes — unquoted variables, incorrect conditionals, portability issues, and deprecated syntax — before they cause failures in production. It is available as a CLI tool and integrates with most editors.
How do I run ShellCheck on my script?
Install ShellCheck with `apt install shellcheck` on Debian/Ubuntu or `brew install shellcheck` on macOS. Then run `shellcheck script.sh`. For CI pipelines, ShellCheck exits non-zero if any warnings are found, making it easy to enforce as a gate.
What does ShellCheck SC2086 mean?
SC2086 warns that a variable is not double-quoted, which exposes it to word splitting and glob expansion. `echo $var` should be `echo "$var"`. If $var contains spaces or special characters, the unquoted version breaks silently in ways that are hard to debug.
Why does ShellCheck flag my script if it works fine?
ShellCheck warns about patterns that work in normal cases but fail in edge cases — variables with spaces, filenames with special characters, or pipelines that swallow errors. Each warning is a real bug risk. The script appears to work until it encounters unexpected input.