I would like to break and error out on a looped block of code, when of any of the commands in the loop return 1. I would like to do this without a sub-shell.
while read file; do
command_one_that_might_error_out;
command_two_that_might_error_out;
command_three_that_might_error_out;
done < <(ls -1 .) || echo "something bad when of the commands ran happened";
Can any one please provide insight?
I haven’t tested it, but this should work: