BASH linter


There's a good linter for BASH called ShellCheck, it can be installed on Debian based systmes with:

# apt-get install shellcheck

You can then invoke it simply from the command line to get feedback on your shell script. The messages are colour coded to indicate their severity: green, yellow and red:

shellcheck

On the fly syntax checking in Emacs

It's easy getting on the fly linting of the BASH scripts you're working on by installing flycheck:

flycheck bash

M-x package-install flycheck

and enable it everwhere:

(setq global-flycheck-mode t)

It will now pick up whatever linting tool you've installed for the current mode, e.g. shellcheck. For a list of all languages and linting tools it supports out of the box, have a look at this list .


Licensed under CC BY Creative Commons License ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🐦 @torsteinkrause