我似乎还记得一些unix命令,该命令可让您在传递到下一个程序时节省输出。
例如
echo "hello world!" \ | mystery_command hello.txt \ | sed -E "s/hello/goodbye/g" \ > goodbye.txt
[都将创建一个名为“ hello world!”的文件hello.txt!作为内容。还有一个名为“ goodbye.txt”的文件,带有“再见的世界!”作为内容。
我相信您正在考虑tee(1)。
tee(1)