Understanding ShellCheck
I recently had to evaluate ShellCheck for work and found it quite useful. ShellCheck detects—and often fixes—syntax issues in shell scripts, so I’m jotting down my notes here.
Installation
ShellCheck is cross-platform, supports multiple operating systems, and many apps integrate it, so you have plenty of ways to use it.
Use it directly in the browser: ShellCheck Web
Visual Studio Code extension: ShellCheck
JetBrains IDEs include the Shell Script plugin; no extra install needed, though in my testing it doesn’t expose the full ShellCheck feature set.
Command-line installation
macOS:
brew install shellcheck
EPEL-based distros
sudo yum -y install epel-release sudo yum install ShellCheck
See the official instructions for the full list of installation methods.
Shell Support
ShellCheck’s static analysis doesn’t cover every shell:
- Supported:
bash
,sh
,ksh
, andzsh
. - Not supported:
fish
,tcsh
, andcsh
. zsh
andksh
support only works where they are compatible withbash
.
Features
Whether you run it manually or automatically, ShellCheck’s job is to highlight syntax mistakes in your shell scripts.
Web Support?
I also looked into running ShellCheck entirely in the browser.
- The official web demo sends your script to the server and runs ShellCheck there.
- Full client-side execution isn’t officially supported right now, but converting the Haskell codebase to WASM might work—no firm conclusion yet.
Final Thoughts
If you write shell scripts regularly, install the plugin in your editor—it can save you from many avoidable syntax errors.