title: source a shell script from another script and check return code
body: <p>I want to source a file eg name.sh from another script and check the return code and decide on it's error code. If I use </p>
  
  <pre><code>source name.sh
  </code></pre>
  
  <p>then if name.sh return non-zero return code my main script stop to run but I need to decide on exit code weather to continue or stop.</p>
  
  <p>If I use</p>
  
  <pre><code>ret_code="`source name.sh`"
  echo $ret_code
  </code></pre>
  
  <p>then ret_code is null and no error code is printed.
  I can't use these:</p>
  
  <pre><code>sh name.sh
  ./name.sh
  bash name.sh
  </code></pre>
  
  <p>because name.sh is not executable and I don't want it to be executable</p>