I'm writing a bash script that should exit the error code of the last failed command and not continue execution. This can be achieved by adding a
|| exit $? everywhere, but is there an easier way, e.g. a
set option at the start to do this without uglifying every line?
set -e ?
You might join all the commands with
if there is no
Best regards, Krzysztof