Appending a GZIP File

Guys,

I just want to know the difference in following (core difference)

zcat a.gz b.gz c.gz |gzip >d.gz

And

zcat a.gz >>d.gz
zcat b.gz >>d.gz
zcat c.gz >>d.gz

do we have 3 gzip header in 1st and only one in second case.
please let me know this in detail

Thanks,
M.Mohankumar.

Hi,

As far as I know, your first command (zcat ... | gzip > d.gz) - 'cat's all the three compressed files - then compresses it, one after another and save it to a single file named d.gz.

In second case, you read a compressed file and append it to a file named d.gz. d.gz is NOT compressed. Adding a 'gz' to a file name does not compresses it.

Regards

sorry ggs,

It is typo err

the actual second case is like

zcat a.gz |gzip >>d.gz
zcat b.gz |gzip >>d.gz
zcat c.gz |gzip >>d.gz

please let me know the exact diffenrence with gzip headers