1

In the GNU bash manual, a list is defined as

A list1 is a sequence of one or more pipelines separated by one of the operators ‘;’, ‘&’, ‘&&’, or ‘||’, and optionally terminated by one of ‘;’, ‘&’, or a newline.

This definition of list is confusing me, when I replace the word pipelines in the definition, it makes more sense to me. I am not able to comprehend how a sequence of Pipelines2 can be separated by the operators ';', '&', '&&', or '||'.

1 Answer 1

5

The Bash man page can often be confusing regarding the terms used there. But your question becomes clear(er) if you read the definition of pipeline:

A pipeline is a sequence of one or more commands separated by one of the control operators | or |&. The format for a pipeline is:

[time [-p]] [ ! ] command [ [|⎪|&] command2 ... ] 

http://man7.org/linux/man-pages/man1/bash.1.html#SHELL_GRAMMAR

In short, a pipeline is either one command with all its parameters, or multiple of them piped into each other. You can combine multiple of these pipelines by the mentioned operators for subsequent (conditional) execution.

1
  • Oh yes, I made a very silly mistake of thinking pipelines should have at least two commands, thank you for pointing it out. This solves my dilemma, a pipeline could be a single command too, I feel so silly. Commented Mar 10, 2020 at 10:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.