title: How to make GNU screen return the last return code to the shell when GNU screen ends
body: <p>I've just noticed GNU screen can run one command at a time, so this statement cannot work :
  </p>
  
  <pre class="lang-bash prettyprint-override"><code>$ screen "command1 || command2"
  </code></pre>
  
  <p>but then this does not work either because GNU screen always returns <code>0</code> when it ends running <code>command1</code> (even if <code>command1</code> returns <code>1</code>) :</p>
  
  <pre class="lang-bash prettyprint-override"><code>$ screen command1 || screen command2
  </code></pre>
  
  <p>How to make GNU screen return the last return code to the shell when GNU screen ends ?</p>