ShellCheck: Shell script analysis tool

[ gpl, library, program, static-analysis ] [ Propose Tags ] [ Report a vulnerability ]

The goals of ShellCheck are:

  • To point out and clarify typical beginner's syntax issues, that causes a shell to give cryptic error messages.

  • To point out and clarify typical intermediate level semantic problems, that causes a shell to behave strangely and counter-intuitively.

  • To point out subtle caveats, corner cases and pitfalls, that may cause an advanced user's otherwise working script to fail under future circumstances.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.7, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.9.0, 0.10.0, 0.11.0 (info)
Dependencies base (>=4 && <4.7), containers, directory, json, mtl, parsec, QuickCheck (>=2.7.4), regex-compat, ShellCheck, transformers [details]
License AGPL-3.0-only
Author Vidar Holen
Maintainer vidar@vidarholen.net
Revised Revision 1 made by vidarhol at 2022-05-20T22:53:27Z
Category Static Analysis
Home page http://www.shellcheck.net/
Bug tracker https://github.com/koalaman/shellcheck/issues
Source repo head: git clone git://github.com/koalaman/shellcheck.git
Uploaded by vidarhol at 2014-11-10T01:02:39Z
Distributions Arch:0.11.0, Debian:0.8.0, Fedora:0.11.0, FreeBSD:0.3.8, LTSHaskell:0.10.0, NixOS:0.10.0, Stackage:0.11.0, openSUSE:0.10.0
Reverse Dependencies 4 direct, 0 indirect [details]
Executables shellcheck
Downloads 50279 total (50 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for ShellCheck-0.3.5

[back to package description]

ShellCheck - A shell script static analysis tool

http://www.shellcheck.net

Copyright 2012-2014, Vidar 'koala_man' Holen Licensed under the GNU Affero General Public License, v3

The goals of ShellCheck are:

  • To point out and clarify typical beginner's syntax issues, that causes a shell to give cryptic error messages.

  • To point out and clarify typical intermediate level semantic problems, that causes a shell to behave strangely and counter-intuitively.

  • To point out subtle caveats, corner cases and pitfalls, that may cause an advanced user's otherwise working script to fail under future circumstances.

ShellCheck is written in Haskell, and requires 2 GB of memory to compile.

Installing

On systems with Cabal:

cabal update cabal install shellcheck 

On Debian based distros:

apt-get install shellcheck 

On OS X with homebrew:

brew install shellcheck 

ShellCheck is also available as an online service:

http://www.shellcheck.net 

Building with Cabal

This sections describes how to build ShellCheck from a source directory.

First, make sure cabal is installed. On Debian based distros:

apt-get install cabal-install 

On Fedora:

yum install cabal-install 

On Mac OS X with homebrew (http://brew.sh/):

brew install cabal-install 

On Mac OS X with MacPorts (http://www.macports.org/):

port install hs-cabal-install 

Let cabal update itself, in case your distro version is outdated:

$ cabal update $ cabal install cabal-install 

With cabal installed, cd to the ShellCheck source directory and:

$ cabal install 

This will install ShellCheck to your ~/.cabal/bin directory.

Add the directory to your PATH (for bash, add this to your ~/.bashrc file):

export PATH=$HOME/.cabal/bin:$PATH 

Verify that your PATH is set up correctly:

$ which shellcheck ~/.cabal/bin/shellcheck 

Running tests

To run the unit test suite:

cabal configure --enable-tests cabal build cabal test 

Happy ShellChecking!