git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] Add basic syntax check on shell scripts

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Dec 5, 2012, 09:11 UTC
Message-ID
<50BF0FCD.6080700@gmail.com>
In-Reply-To
<7vobi9mwt4.fsf@alter.siamese.dyndns.org>
On 2012/12/04 20:39 , Junio C Hamano wrote:
> A few more things in addition to what Torsten's script attempts to
> catch that we would want to catch are:
[...]
 >   * Do not write ERE with backslashes and expect "grep" to grok them;
 >     that's GNUism.  e.g.
 >
 > 	grep "^\(author\|committer\) "
 >
 >     is bad.  Use egrep (or "grep -E") if you want to use ERE.

Yet more thing that is probably worth catching, although not related to bashism: Avoid the use of "which" in favor of e.g. "type".

In any case, having this check as a local pre-commit hook would be great!
-- 
Sebastian Schuberth
Previous: Junio C Hamano
Message 11 of 11 in “[RFC] Add basic syntax check on shell scripts”
  1. Torsten BögershausenDec 2, 2012
  2. Stefano LattariniDec 2, 2012
  3. Junio C HamanoDec 3, 2012
  4. Nguyen Thai Ngoc DuyDec 4, 2012
  5. Junio C HamanoDec 4, 2012
  6. Nguyen Thai Ngoc DuyDec 5, 2012
  7. Junio C HamanoDec 5, 2012
  8. Jeff KingDec 5, 2012
  9. Jeff KingDec 5, 2012
  10. Junio C HamanoDec 5, 2012
  11. Sebastian SchuberthDec 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.