The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


col - filter reverse line-feeds (LEGACY)


col [-bfpx] 


The col utility reads from the standard input and writes to the standard output. It performs the line overlays implied by reverse line-feeds, and by forward and reverse half-line-feeds. Unless -x is used, all blank characters in the input will be converted to tab characters wherever possible.

The ASCII control characters SO and SI are assumed by col to start and end text in an alternative 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 written in the correct character set.

On input, the only control characters accepted are space, backspace, tab, carriage-return and newline characters, SI, SO, VT, reverse line-feed, forward half-line-feed and reverse half-line-feed. The VT character is an alternative form of full reverse line-feed, included for compatibility with some earlier programs of this type. The only other characters to be copied to the output are those that are printable.

The ASCII codes for the control functions and line-motion sequences mentioned above are as given in the table below. ESC stands for the ASCII escape character, with the octal code 033; ESC-x means a sequence of two characters, ESC followed by the character x.

reverse line-feed ESC-7
reverse half-line-feed ESC-8
forward half-line-feed ESC-9
vertical-tab (VT) 013
start-of-text (SO) 016
end-of-text (SI) 017


The col utility supports the XBD specification, Utility Syntax Guidelines  . The following options are supported:
Assume 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 will be output.
Suppress the normal treatment of half-line motions. 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. By suppressing this treatment, the output from col may contain forward half-line-feeds, but will still never contain either kind of reverse-line motion.
Force escape sequences to be passed through unchanged. Normally, col will remove any escape sequences found in its input that are not specified above.
Prevent col from converting blank characters to tab characters on output wherever possible. Tab stops are considered to be at each column position n such that n modulo 8 equals 1.




The standard input is a text file to be translated.




The following environment variables may affect the execution of col:
Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
If set to a non-empty string value, override the values of all the other internationalisation variables.
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files).
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
Determine the location of message catalogues for the processing of LC_MESSAGES .




The standard output is a text file, translated from the standard input.


Used only for diagnostic messages.






The following exit values are returned:
Successful completion.
An error occurred.




The use of the -x option may increase or decrease printing time, depending on the printer type.

Local vertical motions that would result in backing up over the first line of the document are ignored. As a result, the first line must not have any superscripts.

The use of the -f or -p options is discouraged unless the user is aware of the consequences of passing unusual escape sequences to the terminal.







UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]