md5

Christopher Nehren apeiron+usenet at coitusmentis.info
Tue Mar 29 21:31:04 PST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2005-03-30, Lowell Gilbert scribbled these
curious markings:
> Matt Kosht <matt.kosht at gmail.com> writes:
>
>> Is there a simple way to compare the md5 checksum of a file, to a file
>> that contains possibly more than one md5 checksum entry in it?  Kind
>> of like mdsum -c does?
>
> I've never heard of mdsum, but try mtree(8).

Matt is (modulo a typo) referring to the GNU tool md5sum, which is
oh-so-conveniently named differently than the FreeBSD utility (which
causes programs that call it, like mplayer modulo the patch that I sent
in, to fail with "md5sum: not found" errors).

To answer Matt's original question, I've found that something like this
works well. This assumes that CHECKSUM contains the actual checksum of
the file, and only the checksum of that file.

md5 FILE > mine
cmp mine CHECKSUM

Not as short as the GNU version, but still mostly functional. Though,
now that I write this, I remember having written a Perl program that
checks SFV sums against a given .sfv file. The principle is more or less
the same for checking MD5 sums, or $FOO sums, plus a bit of processing.
I'll see if I can't modify that program to do the sort of thing that
matt wants.

Best Regards,
Christopher Nehren
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iD8DBQFCSjllk/lo7zvzJioRAjwYAJ99c7VbvBefbqW2XUHeoD759YxiGQCgs3Z/
+pzROFVhJ3r0dRiwM3sFrpo=
=R79C
-----END PGP SIGNATURE-----

-- 
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong questions, you get answers like "42" and "God".
Unix is user friendly. However, it isn't idiot friendly.



More information about the freebsd-questions mailing list