MPE/iX Shell and Utilities Reference Manual, Vol 2
sum(1) MPE/iX Shell and Utilities sum(1)
NAME
sum — compute checksum and block count for file
SYNOPSIS
sum [–ciprt][file ...]
DESCRIPTION
The sum command calculates a checksum for each input file. It also displays the number of
512-byte blocks in each file. If you do not specify any files or you specify – as the file name,
sum reads the standard input. The checksum is useful as a quick way to compare a file or files
that have been moved from one system to another to ensure that no data have been lost.
sum differs from cksum only in the format of the output. sum’s output has the form
checksum blockcount filename
where blockcount is the number of 512-byte blocks in the file.
sum can calculate checksums in a variety of ways. The default checksum algorithm produces
a 16-bit unsigned integer resulting from the arithmetic addition of each input byte. This
checksum algorithm is insensitive to byte order.
Options
sum accepts the following options:
–c uses a standard 16-bit Cyclical Redundancy Check (CRC-16).
–i uses the CCITT standard Cyclic Redundancy Check (CRC-CCITT). Data commu-
nications network protocols often use a cyclic redundancy check to ensure proper
transmission. This algorithm is more likely to produce a different sum for inputs
which differ only in byte order.
–p uses the
POSIX.2 checksum algorithm.
–r enables the use of an alternate checksum algorithm which has the advantage of being
sensitive to byte order.
–t also produces a line containing the total number of blocks of data read as well as the
checksum of the concatenation of the input files.
1-582 Commands and Utilities