emanuele6 1701036558 learn No. cmd1 && { cmd2;} is not always the same as if cmd1; then cmd2; fi . cmd1 && cmd2; printf %s\\n "$?" prints the exit status of cmd1 if cmd1 failed. if cmd1; then cmd2; fi; printf %s\\n "$?" prints 0 if cmd1 failed. emanuele6 1701039591 forget emanuele6 1701039687 learn cmd1 && { cmd2;} is not always the same as if cmd1; then cmd2; fi . cmd1 && { cmd2;}; printf %s\\n "$?" prints the exit status of cmd1 if cmd1 fails. if cmd1; then cmd2; fi; printf %s\\n "$?" prints 0 if cmd1 fails.