title: execute shell script code depends upon php return value
body: <p>I haven't that  much of knowledge in PHP, and I need to run a script that depends upon the PHP return value.</p>
  
  <h2>script</h2>
  
  <pre><code>presentDir=`pwd`
  success=$(php -f $presentDir/optimize.php $file)
  echo echo "value:".$success
  </code></pre>
  
  <h2>PHP code</h2>
  
  <pre><code>&lt;?php
  try{        
      //code  
  } catch(Exception $e){
      return 1
  }
  return 0
  </code></pre>
  
  <p>When executing the above shell script, success is empty.</p>