It is not possible to determine a suitable name, I do not understand the behavior in the dash / bash. Namely, I use set -e to save if a command and commands fail to process a positive result.
T. General scheme:
[ ! wantcommand ] || command
Than means that the command is run only when necessary, and failure will automatically disable the script.
It may take some post-processing, in which case I use this:
[ ! wantcommand ] || { command && postprocess; }
This led to some curious bughunting, since this one will not kill the shell , and I cannot end this reason. Now I need to execute some pieces of shell code, but I would like to understand the reason.
for testing:
bash -c 'set -e; { false || false && echo "post" ; }; echo "ec $?"'
or
bash -c 'set -e; { set -e; false || false && echo "post" ; }; echo "ec $?"'
. , , 1,