command-syntax

Bash pipeline with stderr

Connect stdout and stderr to the next command; implicit descriptor duplication follows explicit redirections on the left.

Formal Syntax & Structure

bash syntaxbash
command |& command

Return Value

exit status

Connect stdout and stderr to the next command; implicit descriptor duplication follows explicit redirections on the left.

Working Example

Example Snippetbash
{ printf 'data\n'; printf 'note\n' >&2; } |& cat
Bash Reference