title: How to check for bash shell syntax errors in practice?
body: <p>I need to check whether a set of scripts are syntactically correct. I know there are couple of posts around suggesting to use <code>bash -n &lt;script_name&gt;</code> but I run this and I get nothing out e.g.</p>
  
  <p><strong>good.sh</strong></p>
  
  <pre><code>#!/bin/bash
  
  echo "hello"
  </code></pre>
  
  <p><strong>bad.sh</strong></p>
  
  <pre><code>#!/bin1/bash1
  
  eco "hello"
  </code></pre>
  
  <p>If I do:</p>
  
  <pre><code>$ bash -n bad.sh; echo $?
  0
  $ bash -n good.sh; echo $?
  0
  </code></pre>
  
  <p>So how do you discriminate between good and bad exactly?</p>