Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sum(C) — OpenDesktop 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

wc(C)


 sum(C)                        06 January 1993                         sum(C)


 Name

    sum - calculate a checksum and count the blocks in a file

 Syntax

    sum [ -rl ] [ file ] ...

 Description

    The sum command calculates and prints a checksum for the named file, and
    also prints the number of 512-byte blocks in the file.

    If no file is named, standard input is used.

    Options are:

    -l   Print a long (32-bit) checksum.  (The default is to print a short
         (16-bit) checksum.)

    -r   Use an alternate (older) algorithm to compute the checksum.  This
         alternate algorithm is sensitive to the order of the bytes in the
         data; the standard algorithm is not.

    sum is typically used to validate data after being transported across
    unreliable media.  It is also useful when you want to reduce the contents
    of a file into a representative value.

 See also

    wc(C)

 Diagnostics

    ``Read error'' is indistinguishable from ``End-of-file'' on most devices,
    so you need to check the block count.

 Standards conformance

    sum is conformant with:

    AT&T SVID Issue 2;
    and X/Open Portability Guide, Issue 3, 1989.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026