Re: md5sum < file

Jim Meyering <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
Herbert Xu <[email protected]> wrote:
> I'm getting complaints from Debian users regarding the output of
> md5sum < file, which is of the form:
>
> d47fe6e8023a49af77e5885275d7242f  -
>
> The complainants would prefer to see:
>
> d47fe6e8023a49af77e5885275d7242f
>
> which is analogous to the behaviour cksum and wc.
>
> What is your view on this?

Consistency with other programs would be nice,
but md5sum --check must parse that same output, and
its output should stay consistent with that of other
(historical) md5sum implementations.

It's not hard to remove those three trailing characters.
E.g. just pipe the output through tr -d ' -' or sed 's/ .*//'

Hmm... Debian unstable's /usr/bin/md5sum can't handle
the use of `-' as a name for stdin:

  $ echo a |md5sum > x
  $ echo a |/usr/bin/md5sum -c x
  /usr/bin/md5sum: can't open -
  Segmentation fault
  [Exit 139 (SIGSEGV)]

But the one from textutils can:

  $ echo a |md5sum.textutils -c x
  -: OK
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.