sum(1)
_________________________________________________________________
sum Command
print checksum and block count of a file
_________________________________________________________________
SYNTAX
sum [ -r ] file
DESCRIPTION
Sum calculates and prints a 16-bit checksum for the named file,
and also prints the number of blocks in the file. It is
typically used to look for bad spots, or to validate a file
communicated over some transmission line. The option -r causes
an alternate algorithm to be used in computing the checksum.
_________________________________________________________________
EXAMPLES
$ sum record
Prints the file name and checksum for "record", and the number of
512 byte blocks of disk space that "record" occupies. If you
transmit "record" to another system and then execute sum again,
you can check that "record" was transmitted without any errors.
$ sum -r record labels
Calculates the checksum and the number of 512 byte blocks of disk
space for the files "record" and "labels". You use the alternate
algorithm because "record" and "label" were transferred to your
system from a UNIX System Version 7 system. The algorithm used
with the "r" option is compatible with the algorithm used by sum
on UNIX System Version 7 systems. This allows you to compare the
checksum values both before and after the files were transmitted
to check that there are no errors. Sum prints the information
for each file on a separate line.
$ grep -l account /SYSTEMS/* | xargs sum
Grep(1) searches through the directory "SYSTEMS" for files with
the string "account" in them. The command xargs(1) passes each
file found as an argument. Sum prints a checksum, the number of
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
sum(1)
512 byte blocks of disk space, and the file name of each file.
This command is useful for checking that many files transferred
without errors from one system to another.
_________________________________________________________________
SEE ALSO
wc(1).
DIAGNOSTICS
"Read error" is indistinguishable from end of file on most
devices; check the block count.
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)