title: Return Java system exit value to bash script
body: <p>I am trying to get the return value from a java program ( <code>System.exit(1);</code>) into a shell script, but it seems like its returning the jvm exit code, which is always 0, if it doesnt crash. For testing purposes, this is the very first line in my main().
  Anyone know how to do this?</p>
  <p>My bash code:</p>
  <pre><code>java  bsc/cdisc/ImportData $p $e $t
  
  
  #-----------------------------------------
  # CATCH THE VALUE OF ${?} IN VARIABLE 'STATUS'
  # STATUS=&quot;${?}&quot;
  # ---------------------------------------
  STATUS=&quot;${?}&quot;
  
  # return to parent directory
  cd ../scripts
  
  
  echo &quot;${STATUS}&quot;
  </code></pre>
  <p>Thanks</p>