如何在 gnu 并行 运行 时 gzip tee 输出?

How to gzip tee output while running in gnu parallel?

假设我 运行 tee 在并行执行的命令中。

我想对 tee 的输出进行 gzip 压缩:

... | tee --gzip the_file | and_continue

bash 进程替换对这种情况很有用。类似于:

... | tee >(gzip -c the_file) | and_continue

如果您同时选择不同的文件 运行 并且每次都需要以不同的格式设置名称,请查看 以了解必须如何更改(以推迟流程替换为每个并行作业执行操作)。