Bash fail if any single command fails but still run all commands : <p>Probably a simple question but an elegant solution is not coming to mind.  I would like to run a series of commands (each one is a test) and return 1 if any of them returned non-zero.  Typically I would do something like:</p>

<pre><code>thingA &amp;&amp; thingB &amp;&amp; thingC
exit $?
</code></pre>

<p>However, that won't run thingC if thingB fails and I want to ensure that all 3 run.  I can easily think of an inelegant approach:</p>

<pre><code>final_result=0
retval=thingA
if [[ $retval != 0 ]] then
  final_result=1
fi
retval=thingB
...
exit $final_result
</code></pre>

<p>Is there some simple, elegant way to get what I want?</p>
