by taway2012 · 13y ago · 0 comments
Related: anybody has ideas to achieve the following?
display the stdout of a program on the console and also write a gzipped version of stdout to a file.
I currently jump through some hoops (involving two term windows) to achieve. 'tee -a' to a named pipe in one window and in another window, 'gzip <' from that named pipe. Would prefer a single-window, single-command solution.
cmd | tee >( gzip - > cmd.out.gz )PS: 'inevitable', you made the same suggestion. But you seem to be hellbanned.
ls -al | tee >(cat) | gzip -c cat /proc/`pidof program`/fd/2
That, of course, won't eliminate the need for a second terminal.(change to your needs, stdin==1, stdout==2, stderr=3)