help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] automatic syntax check?


From: Dan Douglas
Subject: Re: [Help-bash] automatic syntax check?
Date: Sat, 05 Jul 2014 06:44:15 -0500
User-agent: KMail/4.13.2 (Linux/3.15.0-pf3+; KDE/4.13.2; x86_64; ; )

On Saturday, July 05, 2014 08:51:05 AM Patrick Schleizer wrote:
> How (in)sane would it be to add something like
> 
>     bash -n "$0" || exit 1
> 
> to the beginning of bash scripts to have some basic syntax checking?

I don't think including it in the script helps much. You might want to avoid 
using $0. http://mywiki.wooledge.org/BashFAQ/028

> Any other advise for automatic syntax check?

There are linters. Try http://www.shellcheck.net/

-- 
Dan Douglas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]