Path: utzoo!attcan!uunet!ns-mx!umaxc.weeg.uiowa.edu!williams From: williams@umaxc.weeg.uiowa.edu (Kent Williams) Newsgroups: comp.os.minix Subject: Re: CRC comparisons Message-ID: <789@ns-mx.uiowa.edu> Date: 5 Mar 90 14:41:39 GMT References: <8168@sdcc6.ucsd.edu> <18091@rpp386.cactus.org> Sender: news@ns-mx.uiowa.edu Reply-To: williams@umaxc.weeg.uiowa.edu.UUCP (Kent Williams) Organization: U of Iowa, Iowa City, IA Lines: 41 >I wrote a simple shell script to read the various .crc >files, extract the file names, and echo the crc of the current file, >along with the correct value from the crc file, to an audit file. > The following is what I used, and it didn't seem that slow (slow compared to what, after all?). It massages the 'official' crc file so that it looks like what you'd see if you ran crc in the current working directory. Then it runs crc over the current directory, and compares the two. You will always see a few differences -- figuring out which ones matter are left as an excersize to the reader. A 'perfect' run (for the mm directory, zum bespiel) would print out < 012345 2222 mm.crc < 543210 3333 mm.crc.tmp or something to that effect. --------------------------cmpcrc---------------------------------------- # find out the crc file name for the current directory. f=`pwd` f=`basename $f`.crc # temporary version of .crc o=${f}.tmp # name of the local version. l=${f}.local # strip of the extra path gunk from the crc file, so it can be compared # to a local copy. sed 's/\/head.*\///' $f > $o # get a local crc list crc * > $l # compare local and 'official' crc's diff $o $l # clean up rm $o $l -- Kent Williams "We're One! All One! Exceptions Eternally? williams@umaxc.weeg.uiowa.edu None! Absolutely None!" - Dr. Bronner's Soap