3 ms·
Pretty cool. 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
by taway2012 13y ago
Pretty cool.
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.
- inevitable 13y agoTry this: echo testing | tee -a >(gzip >test.gz)
- _paulc 13y agols -al | gzip -c | tee out.gz | gzip -dc
- runejuhl 13y agoSomething like this? ls -al | tee >(cat) | gzip -c
- runejuhl 13y ago...or you could run something like 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)
- ColinWright 13y agoWhat's wrong with: cmd | tee >( gzip - > cmd.out.gz )
- taway2012 13y agoYeah, I think this is probably going to work. Thx! PS: 'inevitable', you made the same suggestion. But you seem to be hellbanned.