coreutils
[Top][All Lists]
Advanced

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

Re: [coreutils] [PATCH] md5sum: Add option to ignore non-existant files


From: Luther
Subject: Re: [coreutils] [PATCH] md5sum: Add option to ignore non-existant files
Date: Fri, 10 Dec 2010 14:05:25 -0500

Thanks for your comments. This discussion should be useful, even if my
patch is not accepted.

On Fri, 2010-12-10 at 00:38 +0000, Pádraig Brady wrote:
> If you wanted to filter further to just FAILED you could:
> 
>   md5sum -c file.sum 2>/dev/null | grep FAILED$

Or even better:

  md5sum -c md5.sum 2>/dev/null | grep -E '(OK|FAILED)$'

...although, that would still throw out the end warnings (see below).

Ideally, I want the output to look like this:

gcc-4.5.1.tar.bz2: OK
md5sum: WARNING: 15 listed files could not be read

The exit status should probably be 0, but my patch does not affect that.
I'd leave in the warning, because it doesn't flood the screen the way
individual file errors do, and it might be helpful if the user doesn't
know what they're doing.

If the file is corrupt, the output should look like this:

gcc-4.5.1.tar.bz2: FAILED
md5sum: WARNING: 15 listed files could not be read
md5sum: WARNING: 1 computed checksum did NOT match

Erik Auerswald wrote:
>grep $FILENAME MD5SUMS | md5sum -c

This wouldn't work in cases where I have more than one file, which I
would like to be detected automatically. The only filename I should have
to type is MD5SUMS. There might be a way to do this in Ruby. I'll have
to get back to you on that.

Thanks again for the help...
Luther

-- 
Please do not send me Microsoft Office/Apple iWork documents. Send
OpenDocument instead! http://fsf.org/campaigns/opendocument/





reply via email to

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