What does “|&” mean in bash?

前端 未结 2 518
故里飘歌
故里飘歌 2021-01-31 01:39

For example

echo \"aaa\" |& cat 

What does |& mean here?

Is there a website recommended to look up those? Since m

相关标签:
2条回答
  • 2021-01-31 02:16

    This operator pipes both standard output and standard error from the left hand side to the right hand side.

    The Bash reference manual has a comprehensive index of all operators where you can lookup these operators.

    0 讨论(0)
  • 2021-01-31 02:27

    From man 1 bash, section Pipelines:

    If |& is used, command's standard error, in addition to its standard output, is connected to command2's standard input through the pipe

    So it is just like pipe operator |, but piping both stdout and stderr.

    0 讨论(0)
提交回复
热议问题