Jump to content
Fi8sVrs

ShellCheck - A shell script static analysis tool

Recommended Posts

  • Active Members

ShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts:

terminal.png

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.

See the gallery of bad code for examples of what ShellCheck can help you identify!

 

 

Installing

 

How to use

There are a number of ways to use ShellCheck!

 

On the web

Paste a shell script on https://www.shellcheck.net for instant feedback.

ShellCheck.net is always synchronized to the latest git commit, and is the easiest way to give ShellCheck a go. Tell your friends!

 

From your terminal

Run shellcheck yourscript in your terminal for instant output, as seen above.

 

In your editor

You can see ShellCheck suggestions directly in a variety of editors.

vim-syntastic.png

 

 

 

emacs-flycheck.png

 

Download: shellcheck-master.zip

git clone https://github.com/koalaman/shellcheck.git

Source

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...