title: Trying to figure out bash scripting with Sun Grid Engine
body: <p>I'm trying to use integer variables within a bash script for submitting to Sun Grid Engine (using qsub).
  Can someone clarify why this does not work?</p>
  
  <p><code>NUMCORES=32</code></p>
  
  <p><code>#$ -pe mpi $NUMCORES</code></p>
  
  <p>(gives the error "Unable to read script file because of error: Numerical value invalid!
  The initial portion of string "$NUMCORES" contains no decimal number)</p>
  
  <p>But this does:</p>
  
  <pre><code>#$ -pe mpi 32
  </code></pre>
  
  <p>I've looked at some solutions which involve awk or bc but can't seem to make them work.  Obviously I am new to bash scripting - thanks for any help!</p>