[lug] Interesting sum "weakness"

Atkinson, Chip CAtkinson at Circadence.com
Wed Sep 13 11:41:00 MDT 2000


Greetings,

When going through some files, I found two files that were different (using
cmp or diff) yet had the same sum, when using the linux sum and default
options.  The files are in DOS format (cr lf), but that shouldn't make any
difference I would think.

Here's file1:

<TR><TD ALIGN=RIGHT><FONT SIZE=2 FACE="Times New Roman"><I>Report prepared:
</I></FONT><FONT SIZE=2 FACE="Times New Roman"><I>9/11/0
0</I></FONT><FONT SIZE=2 FACE="Times New Roman"><I>, </I></FONT><FONT SIZE=2
FACE="Times New Roman"><I> 2:01:33AM</I></FONT><FONT SI
</I></FONT></TD></TR>Roman"><I>

(all on one line)

Here's file2:

<TR><TD ALIGN=RIGHT><FONT SIZE=2 FACE="Times New Roman"><I>Report prepared:
</I></FONT><FONT SIZE=2 FACE="Times New Roman"><I>9/11/0
0</I></FONT><FONT SIZE=2 FACE="Times New Roman"><I>, </I></FONT><FONT SIZE=2
FACE="Times New Roman"><I> 2:01:52AM</I></FONT><FONT SI
</I></FONT></TD></TR>Roman"><I>

(all on one line)

[catkinson at webi01dbldr archives]$ sum -r file1 file2
58547     1 file1
58547     1 file2
[catkinson at webi01dbldr archives]$ sum -s file1 file2
22818 1 file1
22819 1 file2
[catkinson at webi01dbldr archives]$ cat /etc/redhat-release
Red Hat Linux release 6.2 (Zoot)

Note that the -s option produces a different sum.

Hmmm....

Odd.

Chip




More information about the LUG mailing list