Check those shell scripts online!

Forum rules
Before you post please read how to get help
User avatar
Habitual
Level 12
Level 12
Posts: 4207
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Check those shell scripts online!

Postby Habitual » Thu Aug 01, 2013 5:45 pm

Shellcheck is a static analysis and linting tool for sh/bash scripts. It's mainly focused on handling 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.

Visual feedback on common scripting errors and syntax issues.
It's a Keeper!

Enjoy.
Last edited by Habitual on Tue Nov 12, 2013 7:01 pm, edited 1 time in total.
Windows assumes you're an idiot.
Linux demands proof of it.

jmdeking
Level 2
Level 2
Posts: 57
Joined: Sun Jul 15, 2012 7:59 am

Re: Check those shell scripts onliine!

Postby jmdeking » Thu Aug 22, 2013 7:28 am

Great site, gonna use it when in trouble scripting something :)

User avatar
Habitual
Level 12
Level 12
Posts: 4207
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Re: Check those shell scripts onliine!

Postby Habitual » Thu Aug 22, 2013 4:42 pm

It is, but NOTE:
It likes to 'suggest' escaping some $(sub-shell) processes with "Quote this to prevent word splitting."

for example:

Code: Select all

ec2-copy-image -r us-east-1 --region us-west-2 -s $( awk 'NR==1 {print $2}' "$lst" ) -n "$td" -d "Daily ${suffix} backup" # 'bad substitution' "error" using ${suffix^}


but still, it's a Winner.
Windows assumes you're an idiot.
Linux demands proof of it.

User avatar
xenopeek
Level 23
Level 23
Posts: 19373
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Check those shell scripts onliine!

Postby xenopeek » Tue Aug 27, 2013 3:10 pm

Might be handy, thanks! How did you stumble on this one :) The offline version is something I might be adding.
Image

User avatar
Habitual
Level 12
Level 12
Posts: 4207
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Re: Check those shell scripts onliine!

Postby Habitual » Thu Aug 29, 2013 4:49 pm

xenopeek wrote:Might be handy, thanks! How did you stumble on this one :) The offline version is something I might be adding.


TBH, I'm not certain. I think I grokked it over at Ubuntuforums.org tooling around like I do, looking "under the hood" for challenges/solutions, you know ;)
Windows assumes you're an idiot.
Linux demands proof of it.


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 4 guests