Examples

  1. I entered the following command on my system (a very long time ago, I might add):

            crc *.h \*.sys
    

    It produced the following output:

             3159  0xD65B  BMTBL.H
            10780  0x5495  UTIL.H
            15473  0x064B  REGEXP.H
              178  0x4E87  \CONFIG.SYS
    

  2. I entered the following command on my system (also a long time ago):

            crc -l crc.doc
    

    It produced the following output:

            2409  0x070E5D3F  CRC.DOC
    

  3. The ls \u\brian\bin\*.exe >files.txt command was run to produce a list of files that I wanted to check with crcchk. You should normally specify the full pathname of the files for ls so that you can later run crcchk from any directory—crcchk will attempt to open each file using the name as listed. I then added the comment and blank line to the beginning of the file, as follows:

            # files.txt created on 05/20/91
    
            \u\brian\bin\ati.exe
            \u\brian\bin\b.exe
            \u\brian\bin\cdcl.exe
            \u\brian\bin\config.exe
            \u\brian\bin\ccmt.exe
            \u\brian\bin\cdir.exe
            \u\brian\bin\chmod.exe
    

    The crcchk files.txt files.crc command produced the following file named files.crc:

             7070  0xF359  "\u\brian\bin\ati.exe"
            10000  0x8CFB  "\u\brian\bin\b.exe"
            27630  0x13AC  "\u\brian\bin\cdcl.exe"
            57954  0x5D88  "\u\brian\bin\config.exe"
            14401  0x7352  "\u\brian\bin\ccmt.exe"
            17827  0xDE07  "\u\brian\bin\cdir.exe"
            24053  0xFE94  "\u\brian\bin\chmod.exe"
    

    Now, we can run the crcchk files.crc command any time we want to see if any of those executable files has been changed. We might also want to backup the files.crc file or make it read-only so we don't lose the information it contains.

    Note that since the length and CRC values are missing from the input text file, crcchk calculates 16-bit CRCs for the output file by default.