Re: How redirect command output into zip compressed (!) file ? Sample: "cmd .... >>mylogfile.zip"



Wolfgang Meister wrote:
I could execute a command with simple (=uncompressed) redirection like

cmd ...... >>mylogfile.txt &2>1

Ok. Now I want to do the same with a zip compressed logfile similar
to:

cmd ...... >>mylogfile.txt.zip &2>1

How can I tell the command to use a redirection to a zip (gzip or
bzip2) file?

In other words: You want to pipe the output (STDOUT and STDERR) of one
program through gzip and attach the gzipped stream to a file? Then
you can do this:

cmd ... 2>&1 | gzip >> mylogfile.txt.gz

Attachment: pgpUdmOdsE7Ny.pgp
Description: PGP signature



Relevant Pages