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:
thingA && thingB && thingC
exit $?
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:
final_result=0
retval=thingA
if [[ $retval != 0 ]] then
final_result=1
fi
retval=thingB
...
exit $final_result
Is there some simple, elegant way to get what I want?