ShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts.
The goals of ShellCheck are
The easiest way to install ShellCheck locally is through your package manager.
On systems with Cabal (installs to ~/.cabal/bin):
On Debian based distros:
The goals of ShellCheck are
- To point out and clarify typical beginner’s syntax issues that cause a shell to give cryptic error messages.
- To point out and clarify typical intermediate level semantic problems that cause 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.
The easiest way to install ShellCheck locally is through your package manager.
On systems with Cabal (installs to ~/.cabal/bin):
cabal install ShellCheckCode:
cabal update
Click to expand...
On Debian based distros:
On Arch Linux based distros:Code:
apt-get install shellcheck
Click to expand...
On Gentoo based distros:Code:
pacman -S shellcheck
Click to expand...
On EPEL based distros:Code:
emerge --ask shellcheck
Click to expand...
On Fedora based distros:Code:
yum -y install epel-release
yum install ShellCheck
Click to expand...
On OS X with homebrew:Code:
dnf install ShellCheck
Click to expand...
On OS X with MacPorts:Code:
brew install shellcheck
Click to expand...
On openSUSE:Tumbleweed:Code:
port install shellcheck
Click to expand...
Code:
zypper in ShellCheck
Click to expand...