Commands common to the shell:
1, and list with or list:
1), and List (&&):
Executes the next command when the previous command executes successfully.
When there is an execution failure, reverse the "failure code" directly.
Use:
Statement 1 && Statement 2 && statement 3 && .....
2), or list (| | ):
In contrast to &&, the next statement executes after the current statement fails.
Use:
Statement 1 | | Statement 2 | | Statement 3 | | 。。。。。
3), the above two can be combined, for logical processing.
4), the command can be combined into blocks execution.
Statement 1 && {Statement 2 | | Statement 3}
2, ":" Command:
1), in fact, ":" is an empty command. Used to simplify conditional logic, equivalent to "true"
Like what:
While://Make an infinite loop.
2), for variable settings:
Like what:
: ${var:=value}//may be treated as a command when $var does not have ":".
3, "." Command:
1), used to indicate execution within the current shell, does not create a child shell.
Equivalent to the "source" command.
command used by the shell (1)--"and (&&)", "OR (| | )”,“:”,"."