Checking Bash Scripts

I found this very useful resource that allows you check bash scripts online:

http://www.shellcheck.net/

I’ve been writing quite a few bash scripts lately – amongst other things, I find them useful for running automatic backups and scaffolding out projects from a Github repo starting point.

The tool helps with:

…typical beginner and intermediate level syntax errors and pitfalls where the shell just gives a cryptic error message or strange behavior, but it also reports on a few more advanced issues where corner cases can cause delayed failures.

  • http://www.shellcheck.net/about.html

It is certainly helping me to improve my bash scripting.

Linter Shellcheck in Atom

You can set up Shellcheck as anĀ Atom package.

In Ubuntu:


# Install shellcheck on your system
sudo apt-get install shellcheck

# Install Base linter for Atom
apm install linter

# Install shellcheck
apm install linter-shellcheck

You’ll need to restart Atom.

Resources