col(1)

col(1)

NAME

col - ®lter reverse line-feeds and backspaces

SYNOPSIS

col [-blfxp]

DESCRIPTION

col reads from the standard input and writes onto the standard output. It performs the line overlays implied by reverse line feeds (ASCII code ESC-7),and by forward and reverse half-line feeds (ESC-9and ESC-8).col is particularly useful for ®ltering multi-column output made with the nroff .rt com- mand, and output resulting from use of the tbl preprocessor (see nroff(1) and tbl(1)).

If the -boption is given, col assumes that the output device in use is not capable of backspacing. In this case, if two or more characters are to appear in the same place, only the last one read is output.

If the -loption is given, col assumes the output device is a line printer (rather than a character printer) and removes backspaces in favor of multiply overstruck full lines. It generates the minimum number of print operations necessary to generate the required number of overstrikes. (All but the last print operation on a line are separated by carriage returns (\r); the last print operation is terminated by a newline (\n).)

Although col accepts half-line motions in its input, it normally does not emit them on output. Instead, text that would appear between lines is moved to the next lower full-line boundary. This treatment can be suppressed by the -f(®ne) option; in this case, the output from col may contain forward half-line feeds (ESC-9),but will still never contain either kind of reverse line motion.

Unless the -xoption is given, col converts white space to tabs on output wherever possible to shorten printing time.

The ASCII control characters SO (\016) and SI (\017) are assumed by col to start and end text in an alternate character set. The character set to which each input character belongs is remembered, and on output SI and SO characters are generated as appropriate to ensure that each character is printed in the correct character set.

On input, the only control characters accepted are space, backspace, tab, return, new-line, SI , SO , and VT , (\013), and ESC followed by 7, 8, or 9. The VT character is an alternate form of full reverse line-feed, included for compatibility with some earlier programs of this type. All other non-printing characters are ignored.

Normally, col ignores any unrecognized escape sequences found in its input; the -poption can be used to cause col to output these sequences as regular characters, subject to overprinting from reverse line motions. The use of this option is highly discouraged unless the user is fully aware of the textual position of the escape sequences.

EXTERNAL INFLUENCES

Environment Variables

LANG provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the default value of "C" (see lang(5)) is used. If any of the internationalization variables contains an invalid setting, col will behave as if all internationalization variables are set to "C". See environ(5).

LC_ALL If set to a non-empty string value, overrides the values of all the other internationalization vari- ables.

LC_CTYPE determines the interpretation of text as single and/or multi-byte characters, the classi®cation of characters as printable, and the characters matched by character class expressions in regular expres- sions.

LC_MESSAGES determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output.

NLSPATH determines the location of message catalogues for the processing of LC_MESSAGES.

International Code Set Support

Single- and multi-byte character code sets are supported.

EXAMPLES

col is used most often with nroff and tbl. A common usage is:

HP-UX Release 11i: December 2000

− 1 −

Section 1101

c