From owner-freebsd-questions@FreeBSD.ORG Wed Mar 30 05:31:04 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 813B816A4CE for ; Wed, 30 Mar 2005 05:31:04 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CDB043D3F for ; Wed, 30 Mar 2005 05:31:03 +0000 (GMT) (envelope-from freebsd-questions@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DGVlz-0005m4-2d for freebsd-questions@freebsd.org; Wed, 30 Mar 2005 07:29:47 +0200 Received: from pcp08490587pcs.levtwn01.pa.comcast.net ([68.83.169.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Mar 2005 07:29:47 +0200 Received: from apeiron+usenet by pcp08490587pcs.levtwn01.pa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Mar 2005 07:29:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Christopher Nehren Date: Wed, 30 Mar 2005 05:29:14 +0000 (UTC) Organization: /usr/bin/false Lines: 47 Message-ID: References: <44ekdx94w7.fsf@be-well.ilk.org> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pcp08490587pcs.levtwn01.pa.comcast.net User-Agent: slrn/0.9.8.1 (FreeBSD) Sender: news Subject: Re: md5 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 05:31:04 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2005-03-30, Lowell Gilbert scribbled these curious markings: > Matt Kosht 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.