【发布时间】:2022-01-20 16:16:11
【问题描述】:
我想将流的 stdout 和 stderr 重定向到屏幕和文件。为此,我使用了工具tee。但是,在该流进入文件之前,我想使用管道对其进行转换。到目前为止,我只设法转换到标准输出的流。
例子:
echo 'hello' | tee output.txt | tr 'h' 'e'
=> 这会将eello 输出到标准输出并将hello 保存到 output.txt
但是我想要将hello 打印到标准输出并将eello 保存到 output.txt。
注意:更改输入流不是我的问题的选项。
【问题讨论】:
标签: linux bash redirect pipe tee