Bash - Lists of Commands

> Procedural Languages > Bash Shell and (Unix|Linux) Utilities (XCU)

1 - About

A list of command is a sequence of one or more pipelines

  • separated by one of the operators: ‘;’, ‘&’, ‘&&’, or ‘||’,
  • and optionally terminated by one of ‘;’, ‘&’, or a newline.
Control Operators Definition
; (Semicolon) or newline Delimit commands, start a command sequentially
& (Ampersand) Start a command asynchronously
&& (AND) The next command is executed only if the first command returns true
|| (OR) The next command is executed if the first command doesn't return true

Same as compound list ?

Advertising

3 - Operators Precedence

Of these list operators, ‘&&’ and ‘||’ have equal precedence, followed by ‘;’ and ‘&’, which have equal precedence.

4 - Documentation / Reference