title: strange behaviour : export CLASSPATH=$(JARS=(./lib/*.jar); IFS=:; echo "${JARS[*]}")
body: <pre class="lang-bsh prettyprint-override"><code>export CLASSPATH=$(JARS=(./lib/*.jar); IFS=:; echo "${JARS[*]}")
  </code></pre>
  
  <p>If I put this line in a <code>bash_script.sh</code> and do </p>
  
  <pre><code>chmod +x bash_script.sh
  </code></pre>
  
  <p>and then run </p>
  
  <pre><code>./bash_script.sh
  </code></pre>
  
  <p>it gives the error.</p>
  
  <pre><code>Syntax error: "(" unexpected (expecting ")")
  </code></pre>
  
  <p>How ever I am able to run this thing directly from the prompt and get the expected result.
  as</p>
  
  <pre class="lang-bsh prettyprint-override"><code>$ export CLASSPATH=$(JARS=(./lib/*.jar); IFS=:; echo "${JARS[*]}")
  </code></pre>
  
  <p>I was wondering what is the reason for this strange behaviour.</p>