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: Pádraig Brady
Subject: Re: [coreutils] [PATCH] md5sum: Add option to ignore non-existant files
Date: Fri, 10 Dec 2010 00:38:46 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 09/12/10 03:14, Luther wrote:
> Normally, when I use md5sum, it's when I download a file and an MD5SUMS
> file that comes with it. This MD5SUMS file usually lists many files
> including the one I downloaded. When I run 'md5sum -c MD5SUMS', I get
> many error messages about files that I don't have. Obviously, I don't
> care about the files I didn't download, and the error messages make it
> difficult to see the output relating to the file that I do care about.
> 
> I suggest a new option, -i/--ignore-missing, which ignores any filenames
> that do not exist on the filesystem.
> 
> In my patch, the option simply suppresses both relevant error messages.
> Another approach might be to have digest_check check to see if the file
> exists. If it doesn't, don't call digest_file or print the 'FAILED'
> message.
> 
> Sorry if my patch is a little messy, being in 3 parts. I'm not used to
> using git.
> 
> HTH, and let me know what you think...
> Luther

Thanks for the patch,
and sorry for the mailing list delay
(I'm not sure what moderation is done on these lists)

So you would like to filter out the warnings.
Well they go to stderr, so you could just:

  md5sum -c file.sum 2>/dev/null

If you wanted to filter further to just FAILED you could:

  md5sum -c file.sum 2>/dev/null | grep FAILED$

It has the disadvantage of being longer to type
but the advantage of using existing tools and
options to do the filtering.  So at first glance
this option doesn't seem needed.

cheers,
Pádraig.



reply via email to

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