WCW(1) User Commands WCW(1) NAME wcw - word count with width SYNOPSIS wcw [ -_l ] [ _f_i_l_e ] DESCRIPTION This is a variant of the classical UNIX (tm) program "wc". "wc" is an abbreviation for "word count." That program counts the number of lines, words, and bytes in a file. If _f_i_l_e is not specified, "wc" reads standard input. This variant, in addition, attempts to determine the _w_i_d_t_h of the file it is examining. Thus, for each line wcw counts the number of printing characters including blank spaces. The width of the file is the length of its longest line. Control sequences for console commands, whether initiated by the "[" control sequence introducer (hex 1B5B) or by hex code 9B are not counted. Only such control sequences ending with a control sequence terminator are treated treated this way. A control sequence terminator is any character with hex code from 40 to 7f, the range consisting of upper and lower case letters and a few other characters but _n_o_t the digits from 0 to 9. Any characters beginning with one of the two control sequence introducers up to and including the terminator are considered to be part of a con- trol sequence. Tab characters are given the value +3 for the purpose of determining the width of a line, and back- space characters are given the value -1. Other non-printing characters are not counted. Printing characters are what- ever characters in the current font are represented by hex codes 20-7F and A0-FF. The -_l option switch, if specified, turns on "long output". Under this option, wcw outputs the width of each line right justified in a field of width 3 with the widths of succes- sive lines separated by newlines. Since the number of lines in this output is equal to the number of lines in the origi- nal file, this output of width 3 could, with an appropriate tool, be pasted to the original file to assist the user in locating lines of specified length. It is useful to know the width of a file before attempting to print it. Thus, for example, a plain text file of width 80, will normally print without unwanted line-wrapping in a pica font on 8.5 x 11 inch paper. Entering wcw alone on the command line will cause wcw to read standard input. If it is not part of a pipeline, then wcw will wait indefinitely for keyboard input until it receives an "end-of-file". SunOS 5.5.1 Last change: 19 Aug 1997 1 WCW(1) User Commands WCW(1) FILES None. BUGS The handling of a file that does not end with a newline is debatable. The handling of formfeeds is debatable. The handling of the DEL character (hex 7F) is debatable. Tab characters, if present, are assigned constant width 3. The use of tab characters, where width is an issue, is, in general, unpredictable and deprecated. (Programmable edit- ing tools may usually be configured to have the tab key gen- erate sequences of blank spaces corresponding to tab stop settings.) There are no command line switches for lines only, words only, etc. It might be useful for _w_c_w to accept more than one _f_i_l_e argument. Please send problem reports or comments to W. F. Hammond at the email address "hammond@math.albany.edu". SEE ALSO _f_w_i_d(1) SunOS 5.5.1 Last change: 19 Aug 1997 2