Dan Jacobson <[EMAIL PROTECTED]> writes:

> $ md5sum test/*|sed 1s/./Z/|>/dev/null md5sum -c --status -w -; echo $?
> md5sum: standard input: 1: improperly formatted MD5 checksum line
> 0
> $ md5sum test/*|sed 1s/./Z/|>/dev/null md5sum -c -; echo $?
> 0
> $ md5sum test/*|sed  s/./Z/|>/dev/null md5sum -c -; echo $?
> md5sum: standard input: no properly formatted MD5 checksum lines found
> 1 #Oh boy, only if they are all bad can one finally get non-zero!
> $ md5sum test/*|sed 1s/./Z/|>/dev/null md5sum -c --status -; echo $?
> 0
> $ md5sum --version
> md5sum (GNU coreutils) 5.93
>
> If this all is POSIX to blame, then you had better put warnings on the
> info and man pages: "Note: all it takes is one properly formatted line
> (doughnut) to payoff the police force".

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.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to