trainbogo.sh tune

RW rwmaillists at googlemail.com
Sun Mar 1 19:48:00 CET 2009


On Tue, 17 Feb 2009 10:28:40 +0100
"Matthias Andree" <matthias.andree at gmx.de> wrote:

> Am 17.02.2009, 00:05 Uhr, schrieb RW <rwmaillists at googlemail.com>:

> > Or simply make the script more portable e.g.
> >
> > if [ `which md5sum` ] ;then
> >    MD5='md5sum | sed "s/  -//"'
> > elif [ `which md5` ]; then
> >    MD5=md5
> > fi
> > ...
> > md5=$(printf "%s" "${rndseed}${i}" | $MD5
> 
> Only that md5 and md5sum have different command line options and
> different output format...

If you pipe data through md5 it simply writes a hexadecimal string to
stdout. The script uses sed to strip-off the superfluous "-" that
md5sum leaves behind when used in the same way. Bogotrain.sh only uses
md5sum once, so the other differences between the two utilities don't
matter.

Actually md5 hashing isn't really needed here at all, it's just used to
prepend a random hexadecimal string to the file paths so sort can
put them in random order.  Even a simple PRNG would do just as well.




More information about the Bogofilter mailing list