bash “|&”在bash中是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35384999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:14:10  来源:igfitidea点击:

What does "|&" mean in bash?

bash

提问by Nan Hua

For example

例如

echo "aaa" |& cat 

What does |&mean here?

|&这里是什么意思?

Is there a website recommended to look up those? Since most search engines can't support searching special characters.

有没有推荐的网站来查找这些?由于大多数搜索引擎不支持搜索特殊字符。

回答by Oleg Andriyanov

From man 1 bash, section Pipelines:

man 1 bash,部分管道

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

如果使用|&,command 的标准错误,除了它的标准输出,还通过管道连接到command2 的标准输入

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

所以它就像管道操作符一样|,但同时管道化标准输出和标准错误。

回答by lunaryorn

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

该运算符将标准输出和标准错误从左侧输送到右侧。

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

猛砸参考手册具有所有的运营商在这里你可以查找这些运营商的一个综合指标。