View Single Post
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#7
Just for completeness:

$ command1 ; command2
= execute first command1 and then command2, no matter what.

$ command1 && command2
= execute command1 and then command2 only if command1 exits 0 (= success)

$ command1 || command2
= execute command1 and then, if it fails (exit code != 0) execute command2
 

The Following 8 Users Say Thank You to reinob For This Useful Post: