MPE/iX Shell and Utilities Reference Manual, Vol 2

wc(1) MPE/iX Shell and Utilities wc(1)
NAME
wc — count of newlines, words, bytes, and characters
SYNOPSIS
wc [–c–m][–lw][file ...]
DESCRIPTION
wc counts the number of newlines, words, characters and bytes in text files. If you specify
multiple files, wc produces counts for each file, plus totals for all files. If you did not specify
any options, wc produces the following output:
newline_count word_count byte_count filename
When you specify options, wc displays only the selected counts in the same order as the de-
fault output. If you specify –m, the character count replaces the byte count. For example, –cw
displays the word count followed by the byte count and the file name and –ml displays the
newline count followed by the character count and file name.
A word is considered to be a character or characters delimited by white space.
Note: The –c option of wc counts bytes, not characters. This is a change from previous ver-
sions of wc, dictated by the
POSIX.2 standard which provides the –m option to count charac-
ters. If you have a file containing multibyte characters, the byte count is higher than the char-
acter count.
Options
wc accepts the following options:
–c displays a byte count. You cannot specify this option with –m.
–l displays a newline count.
–m displays a character count. You cannot specify this option with –c.
-w displays a word count.
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 Failure because of an inability to open the input file.
2 Failure because of an invalid command line option.
1-694 Commands and Utilities