Favicon of shellcheck

shellcheck

Static analysis tool that identifies syntax errors, semantic issues, and edge cases in bash and sh scripts with actionable suggestions for fixes.

ShellCheck is a powerful static analysis tool designed to help developers write better shell scripts by catching common mistakes before they cause problems in production. Whether you're a beginner learning shell scripting or an experienced developer managing complex scripts, ShellCheck identifies issues at multiple levels.

Key capabilities include:

  • Beginner-friendly detection: Catches syntax errors and cryptic issues that cause confusing shell error messages
  • Semantic analysis: Identifies intermediate-level problems that cause scripts to behave unexpectedly or counter-intuitively
  • Advanced edge case detection: Spots subtle pitfalls and corner cases that may cause working scripts to fail under different circumstances
  • Comprehensive issue coverage: Detects problems with quoting, conditionals, frequently misused commands, typing errors, data handling, and robustness concerns

Multiple ways to use it:

  • Web-based interface at shellcheck.net for quick feedback without installation
  • Command-line tool for local script analysis
  • Editor integration with Vim, Emacs, VSCode, Sublime, and other editors
  • CI/CD pipeline integration with Travis CI, GitHub Actions, CircleCI, GitLab, and many other platforms
  • Build system integration through Makefiles and test suites

ShellCheck outputs results in multiple formats including human-readable text, JSON, XML, and GCC-compatible warnings, making it easy to integrate into your existing workflows. The tool is open source (GPLv3) and available across Linux, macOS, Windows, and other platforms through various package managers and Docker.

Install

Winget
$ winget install --id

Features

JSON outputScriptable

Shell features

POSIX compatible

Media

Pros

4
  • Identifies syntax errors and semantic issues in shell scripts.
  • Provides actionable suggestions for script fixes.
  • Supports integration into build and test suites.
  • Offers various output formats for customization.

Related tools

Categories:

Share:

Auto-fetched .

Recent releases

Similar to shellcheck

Favicon

 

  
 
Favicon

 

  
 
Favicon