Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (s) sum(1)
NAME
sum - Displays the checksum and block count of a le
SYNOPSIS
sum [-o | -r ][le ... ]
FLAGS
-o Computes the checksum using a word-by-word computation algorithm.
-r Computes the checksum using the more rigorous byte-by-byte computation algorithm.
This is the default action.
DESCRIPTION
The sum command reads le and calculates a 16-bit checksum and the number of 512-byte
blocks in the le. If the le operand is omitted, sum reads the standard input le.
The checksum and number of blocks are written to the standard output le.
Environment Variables
The following environment variables affect the execution of the sum command:
LANG Provides a default value for the internationalization variables that are unset or
null. If LANG is unset or null, the corresponding value from the default locale is
used. If any of the internationalization variables contain an invalid setting, the
utility behaves as if none of the variables have been dened.
LC_ALL If set to a nonempty string value, overrides the values of all the other internation-
alization variables.
LC_CTYPE Determines the locale for the interpretation of sequences of bytes of text data as
characters (for example, single-byte as opposed to multibyte characters in argu-
ments).
LC_MESSAGES
Determines the locale to be used to affect the format and contents of diagnostic
messages written to the standard error le.
NLSPATH Determines the location of message catalogs for the processing of
LC_MESSAGES.
EXAMPLES
To display the checksum of datale and the number of blocks in this le, enter:
sum datale
If the checksum of datale is 1605 and if the le contains 3 blocks, sum displays:
1605 3 datafile
NOTES
The sum command is typically used to determine whether a le that was copied or communi-
cated over transmission lines is an exact copy of the original.
Portable applications should use the cksum command instead of the sum command.
EXIT VALUES
The following exit values are returned:
0 Successful completion.
527188-003 Hewlett-Packard Company 863