Evaluating bash "&&" exit codes behaviour Evaluating bash "&&" exit codes behaviour bash bash

Evaluating bash "&&" exit codes behaviour


You can read in the man pages of bash:

-e   Exit  immediately if a simple command (see SHELL GRAMMAR above) exits with a     non-zero status. The shell does not exit if the command that fails is part of the     command list immediately following a while or until keyword, part of the test in     an if statement, part of a && or || list, or if the command's return value is being     inverted via !.  A trap on ERR, if set, is executed before the shell exits.