Re: diff on .gz and .bz2 files
jellybean stonerfish <[email protected]> Sat, 30 Jan 2010 16:11:43 GMT
| Newsgroups | gmane.comp.gnu.utils |
|---|---|
| Organization | DSL Extreme |
| Message-ID | <[email protected]> |
On Fri, 29 Jan 2010 09:20:22 -0600, Peng Yu wrote: > It seems that diff can not do comparison on the decompressed files in > .gz and .bz2 files. I could first decompress the .gz and .bz2 file and > then do the comparison. But it would be convenient to be able to > directly compare without explicitly decompressing any files. Could > somebody add this feature to diff? You could make a little script pretty easy. $ cat /home/js/bin/gzbzdiff #!/bin/bash mkfifo gzi mkfifo bzi gunzip -c $1 > gzi & bunzip2 -c $2 > bzi & diff -s bzi gzi rm bzi gzi $ gzbzdiff nsd.gz nsd.bz2 Files bzi and gzi are identical