Forrest logo
tool overview
On this page you find all important commands for the CLI tool shellcheck. If the command you are looking for is missing please ask our AI.

shellcheck

Shellcheck is a command line tool that analyzes shell scripts and provides feedback on potential issues and errors. It is used to improve the quality and reliability of shell scripts by catching common mistakes and suggesting improvements.

Shellcheck supports various shell languages including Bash, Dash, Ksh, and Shell. It can be used on Linux, macOS, and other Unix-like systems.

The tool identifies issues like syntax errors, deprecated code, incorrect variable usage, unquoted variables, and unused variables. It also checks for potential security vulnerabilities and suggests safer alternatives.

Shellcheck provides clear and detailed error messages, making it easier for developers to understand and fix the identified issues. Each error message includes a code reference and a suggested correction.

It can be integrated with various text editors and IDEs, allowing developers to receive real-time feedback while writing shell scripts. It can also be integrated into continuous integration (CI) pipelines to automate the code quality checks.

Shellcheck has a comprehensive set of customizable options, enabling users to adjust the desired level of strictness and customize which checks to enable or disable.

The tool is open source and actively maintained, with regular updates and contributions from a community of developers. It follows a robust testing process to ensure accuracy and reliability.

Shellcheck can be easily installed using package managers like apt, yum, homebrew, or downloaded directly from the project's GitHub repository.

Using Shellcheck helps improve the maintainability of shell scripts, reduces the likelihood of bugs, and promotes best practices for shell scripting. It is a valuable tool for both novice and experienced shell script developers.

List of commands for shellcheck:

  • shellcheck:tldr:07d1e shellcheck: Display output in the specified format (defaults to `tty`).
    $ shellcheck --format ${select} ${path-to-script-sh}
    try on your machine
    explain this command
  • shellcheck:tldr:0c1b2 shellcheck: Check a shell script interpreting it as the specified shell dialect (overrides the shebang at the top of the script).
    $ shellcheck --shell ${select} ${path-to-script-sh}
    try on your machine
    explain this command
  • shellcheck:tldr:41651 shellcheck: Also check any sourced shell scripts.
    $ shellcheck --checked-sourced ${path-to-script-sh}
    try on your machine
    explain this command
  • shellcheck:tldr:53174 shellcheck: Ignore one or more error types.
    $ shellcheck --exclude ${SC1009,SC1073} ${path-to-script-sh}
    try on your machine
    explain this command
  • shellcheck:tldr:85bfb shellcheck: List all available optional checks that are disabled by default.
    $ shellcheck --list-optional
    try on your machine
    explain this command
  • shellcheck:tldr:8cdc8 shellcheck: Check a shell script.
    $ shellcheck ${path-to-script-sh}
    try on your machine
    explain this command
  • shellcheck:tldr:d66e0 shellcheck: Enable one or more optional checks.
    $ shellcheck --enable=${select}
    try on your machine
    explain this command
tool overview