Evaluating bash "&&" exit codes behaviour

Answer #1 100 %

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.

You’ll also like:

© 2023 CodeForDev.com -