|
|
The ``&&'' separator executes a command only if the previous command returned a ``true'' status.
The ``||'' separator executes a command only if the previous command returned a ``false'' status. Thus:
This example: | Can also be written: |
---|---|
a || b | if a; else b; fi |
a && b | if a; then b; fi |
a && b || c | if if a; then b; fi else c; fi |
a && b || cThe operators ``|'', ``&'', ``;'', ``::'', ``&&'', and ``||'' can also be preceded or followed by spaces and tabs.
See also: