title: Bash get return value of a command and exit with this value
body: <p>I want to execute a command then get the return value of this command.
  when  it's done i want to exit and give exit the return value of the previous command, the one i just executed. I already have this piece of code but it doesn't seem to work.</p>
  
  <pre><code>exec gosu user /var/www/bin/phpunit -c app
  typeset ret_code
  ret_code=$?
  if [ $ret_code == 0 ]; then
      exit 0
  fi
  
  exit 1
  </code></pre>
  
  <p>how can i do it ? thanks </p>