GNU bug report logs -
#26002
[patch] md5sum --digest-only
Previous Next
Reported by: Michael Vogt <mvo <at> ubuntu.com>
Date: Mon, 6 Mar 2017 16:20:02 UTC
Severity: wishlist
Tags: patch, wontfix
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Mon, Mar 06, 2017 at 08:26:07PM -0800, Pádraig Brady wrote:
> On 05/03/17 23:55, Michael Vogt wrote:
[..]
> > `md5sum /etc/papersize 2> /dev/null | awk '{print $1}'`
> > `md5sum /etc/lsb-release | cut -d" " -f1`
> > $(md5sum /etc/networks | sed -e 's/ .*//')
> >
> > Having a --digest-only option in md5sum would make this a bit more
> > uniform.
> >
> > Attached is a small patch, if the suggestion gets accepted I'm happy
> > to flesh it out more and write the man-page entry and tests.
>
> This is one of those marginal ones, previously discussed as indicated at:
> https://www.gnu.org/software/coreutils/rejected_requests.html#checksum
[..]
Aha, thanks! I found the discussion about it now and see this was
already discussed. Sorry that I have not found in earlier.
> Note your forms above don't handle the case where a leading '\'
> is added for certain edge case filenames.
> The most general solution would be something like:
>
> md5sum < the_file | cut -f1 -d' '
Thanks for this. I was mostly working on this because I saw a bunch of
different ways to solve this problem. Here is another example:
hash=$(set -- $(md5sum some-file) && echo "$1")
(and there are more).
Given that it is a common use-case I was hoping that *sum could
provide a single obvious way to do it. But I do understand that each
extra option adds maintenance burden of coreutils.
> I suppose you could avoid the new option and behave like wc.
> I.E. don't print the extraneous '-' at all.
> That would also be backwards compat with all the processing forms above.
> Though not forwards compat, in that new scripts running against
> older versions of md5sum would now not work.
> Given the minimal/obvious processing involved,
> I'm still slightly in favor for leaving as is.
For my use-case it would be a nice step forward. The scripts I deal
with usually run in the context of a given distro release.
Cheers,
Michael
This bug report was last modified 6 years and 267 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.