是否有一个gnu / unix命令来保存文件而不消耗流?

问题描述 投票:0回答:1

我似乎还记得一些unix命令,该命令可让您在传递到下一个程序时节省输出。

例如

echo "hello world!"  \
| mystery_command hello.txt \
| sed -E "s/hello/goodbye/g" \
> goodbye.txt

[都将创建一个名为“ hello world!”的文件hello.txt!作为内容。还有一个名为“ goodbye.txt”的文件,带有“再见的世界!”作为内容。

unix pipe gnu
1个回答
3
投票

我相信您正在考虑tee(1)

© www.soinside.com 2019 - 2024. All rights reserved.