简体   繁体   English

2>&1 和 2>>&1 有区别吗?

[英]Is there diffrence in 2>&1 vs 2>>&1?

Is there difference in 2>&1 and 2>>&1 in Linux? Linux 中的2>&12>>&1有区别吗?

I know about > and >>.我知道 > 和 >>。 Also know about 1,2,3 mean standard output/error/input.还知道 1,2,3 平均标准输出/错误/输入。

I got a syntax error in bash.我在 bash 中遇到语法错误。

$ echo hello 2>>&1
-bash: syntax error near unexpected token `&'`

>> only works with a real file path >>仅适用于真实文件路径

$ echo hello 1>>/tmp/xx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM