Skip to main content
added 3 characters in body
Source Link
Tim
  • 106.8k
  • 234
  • 651
  • 1.1k

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?

In Bash, the following works

$ for f in ls *; do echo $f; done | cat

$ for f in $(ls *); do echo $f; done | cat

but the first component command of the pipeline isn't simple but compound.

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?

In Bash, the following works

$ for f in ls *; do echo $f; done | cat

but the first component command of the pipeline isn't simple but compound.

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?

In Bash, the following works

$ for f in $(ls *); do echo $f; done | cat

but the first component command of the pipeline isn't simple but compound.

added 73 characters in body
Source Link
Tim
  • 106.8k
  • 234
  • 651
  • 1.1k

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?

In Bash, the following works

$ for f in ls *; do echo $f; done | cat

but the first component command of the pipeline isn't simple but compound.

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?

In Bash, the following works

$ for f in ls *; do echo $f; done | cat

but the first component command of the pipeline isn't simple but compound.

Source Link
Tim
  • 106.8k
  • 234
  • 651
  • 1.1k

Is a pipeline made of simple commands?

From Bash Reference Manual

A pipeline is a sequence of simple commands separated by one of the control operators | or |&.

From POSIX 2013

A pipeline is a sequence of one or more commands separated by the control operator |.

I know that Bash has many extensions to POSIX shells, e.g. |&.

But are the component commands of a pipeline

  • simple commands or
  • just any commands (simple, pipeline again, list, compound, and function)?