help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff on .gz and .bz2 files


From: jellybean stonerfish
Subject: Re: diff on .gz and .bz2 files
Date: Sat, 30 Jan 2010 16:11:43 GMT
User-agent: Pan/0.132 (Waxed in Black)

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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]