海绵和三通之间的区别 [英] Differences between sponge and tee
问题描述
在做一些工作时,我发现此海绵"命令的功能与"tee"相同,但是找不到何时使用哪种更好.
While doing some work, I found this "sponge" command that does the same as "tee", but could not find when it is better to use one or the other.
有人可以解释吗?
推荐答案
没有人吸收 stderr ;仅 stdout . ' tee '在 stdout 和文件上写入 stdin . "海绵"仅将 stdin 写入文件;没有错误,没有输出. (即:与" tee "不同,"海绵"不会在 stdout 上书写). 此外,
No one of them soak up stderr; only stdout. 'tee' writes stdin on stdout and files. 'sponge' writes stdin only on a file; without errors, no output. (i.e: Unlike 'tee', 'sponge' doesn't write on stdout). Besides,
海绵吸收所有输入,然后再打开输出文件"
"sponge soaks up all its input before opening the output file"
(摘自手册)
它们之间的区别极为相关:" tee "读取一个字节",然后写入该字节"; "海绵"等待接收所有输入,然后将其写入.
This difference between them is extremely relevant: 'tee' "reads a byte", and "writes that byte"; 'sponge' waits to receive all the input, and then, writes it.
阅读手册页很有帮助.
这篇关于海绵和三通之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!