Re: trainbogo.sh tune
RW <[email protected]>
| Newsgroups | gmane.mail.bogofilter.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 17 Feb 2009 10:28:40 +0100 "Matthias Andree" <[email protected]> wrote: > Am 17.02.2009, 00:05 Uhr, schrieb RW <[email protected]>: > > 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. _______________________________________________ Bogofilter mailing list [email protected] http://www.bogofilter.org/mailman/listinfo/bogofilter