简体   繁体   English

如何在Bash中重定向输出

[英]How can I redirect output in Bash

I work with program which usage is "program input-file output-file". 我使用的程序是“程序输入文件输出文件”。 How can I write the result in STDOUT and don't write it into the output-file. 如何在STDOUT中写入结果,而不将其写入输出文件。 Thanks. 谢谢。

/dev/stdout用作输出文件名。

Use /dev/fd/1 or /dev/stdout as the output file. 使用/dev/fd/1/dev/stdout作为输出文件。 Some programs will recognize - to mean stdout , or will even use it automatically if the output file is omitted, but this is up to the individual program (unlike the /dev ones which are system services, although sometimes emulated by shells on systems that lack them). 有些程序会识别-表示stdout ,或者,如果省略了输出文件,甚至会自动使用它,但这取决于单个程序(与/dev的系统服务不同),尽管有时由缺少系统的shell来模拟他们)。

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

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