Paul Eggert <[EMAIL PROTECTED]> wrote: ... > I agree that the current behavior is confusing. I'd prefer it if any > improperly formatted line caused a nonzero exit status. Is there some > reason things are done the way that they are? > > At the very least there should be an option to cause an error if the > input file is improperly formatted. I think the option should be > enabled by default.
I think it was designed that way so that you can pipe an announcement message to `md5sum -c' and not get failures for all of the non-checksum lines (ask the author, Ulrich Drepper if you want to be sure). Obviously, when the input is intended to be *only* checksum/filename pairs, then the current behavior doesn't make sense. I think we need a new option to enable the desired behavior. However, I don't think we can make it the default -- there's probably too much existing usage that would break as a result of such a change. Another (independent) option is be to relax the first-cut checksum line validation code so that checksum strings tweaked not to contain all hexadecimal bytes (maybe as long as they're non-white-space) would still evoke a mismatch error. Then, substitutions like Dan's s/./Z/ would not go unnoticed -- but s/./ / would, so this is probably not worthwhile. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils