The
&& (Command execution Control) syntax is formatted as follows: Command1 && command2 [&& Command3 ...] 1 use && connection between commands to implement logic and functions. 2 only the command on the left of && returns True (command return value $?). = = 0) The command to the right of,&& will be executed. 3 As long as there is a command return False (command return value $?) = = 1), the subsequent command will not be executed.
|| The syntax Format (Command execution Control) is as follows: Command1 | | Command2 [| | Command3 ...] 1 Use between commands | | A connection that implements logic or functionality. 2 Only in | | The left command returns False (the command returns a value of $?). = = 1), | | The command on the right will not be executed. This is the same as the logical or syntactic function in C, which is to implement short-circuit logic or operations. 3 As long as there is a command return True (command return value $?) = = 0), the subsequent command will not be executed.
Linux Shell && | |