[Bug 84467] Re: md5sum can't read md5 files with CRLF line terminators
Keith
dkstathem at gmail.com
Thu Feb 16 08:10:18 UTC 2017
As far as I can tell,
sed 's/\r$//' checksums.md5 | sed 's/\r/\n'/ | md5sum -c
works exactly as expected. If I knew where to find the source for this, I'm so annoyed I might try to decipher it. I'm not very good, but it seems like it would translate.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/84467
Title:
md5sum can't read md5 files with CRLF line terminators
Status in coreutils:
Confirmed
Status in coreutils package in Ubuntu:
Triaged
Bug description:
Binary package hint: coreutils
I know this is going to be weird, but...
I'd very much like it if tools like md5sum handled files with CRLF
terminators better. I just tried checking a set of files using an .md5
summary generated on windows, and it doesn't work.
(1) This is really annoying. It took me five minutes to figure out
that it was the line terminators that were the problem. This was
compounded by the fact that neither "cat", "vi" nor "gedit" show any
sign of the distinction by default.
(2) This kind of issue is never going away, and it'll only grow with
more people using both systems. Already most tools, including almost
every text editor, do this by default.
(3) It's more than annoying: I intended to write a script that (among
many other things) checks such files often. If I need to check the
line terminators myself, it's going to take several times more effort.
(Well, at least double the amount.) And this will have to be done for
all such scripts.
(4) In the case of md5sum, there really is no excuse not to accept the
other kind of terminators. The syntax of the .md5 files is _very_ easy
to parse, CRLF terminators never change in any way the semantic, and
reading the .md5 files is a negligible effort compared with actually
checking the hashes, so there's no "inefficiency" problem. There's no
chance of backwards incompatibility, as long as output always uses the
same terminators it used to.
(5) The current errors shown for such files are nonsensical. (More
precisely, they don't indicate the problem unless you're already
familiar with it.)
This feature request is written for md5sum because that's where I had a problem, but I'm sure this applies for many other core utils.
To manage notifications about this bug go to:
https://bugs.launchpad.net/coreutils/+bug/84467/+subscriptions
More information about the foundations-bugs
mailing list