The problem is that the $b then starts with a * and you don't know
what happens if the filename contains nonstarndard characters like LF.
Some md5sum dialects just create garbage, others escape the MD5 sum.

md5chk doesn't do this and was designed from ground up for bash usage.
It guarantees that the md5 sum always is "clean" and the filename
always is properly escaped for shell reads. Note that there is no way
for shell reads to express the newline character nor spaces at the end
of an argument. So an unescape via ANSI strings must be done, sorry.

History:

Now large files (more than 2 GB) can be processed, one of my machines exposed that bug to me.

Checksumming a large file with options -l and -m I observed the problem, that long parts of NUL blocks always have an equal sum. So the interleaving still does not protect against wrong ordering.

The complete sum will detect this, however this leaves a big puzzle on how to assemble all the pieces such that they are ok again. This now is solved with the new option -k.

By mixing in the block number into the MD5 hash, the hashes become unique, such that - with interleaving - you can sort all block such that they fit where they belong. (It's still a nontrivial task, but can be done.)

Option -p initalizes the MD5 algorithm with some arbitrary string.
This is to modify the md5 algorithm, to change calculated values.
For example 'md5chk -p a -d b c' gives the same as 'md5chk -d ab ac',
but the prefix is not shown in the output.

The new integration option --shit is prepared, but not yet operational.
(Sorry for the name, but I needed a silly option name which will not
interfere with another option which already is in use.)
Before you ask: SHIT will provide a built in co-processing method like
shell pipes. However it will skip many fork() calls which are very slow
platforms like CygWin. It also will work over network sockets.

License and Disclaimer

All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2011 by Valentin
Hilbig
Note that the software comes with absolutely no warranty of any kind.
You use the software at your own risk.
Valentin Hilbig cannot be hold responsible for any unintended damage,
lost data or malfunction of the software you can find here.