xref: /openbsd/usr.bin/col/col.1 (revision db3296cf)
1.\"	$OpenBSD: col.1,v 1.8 2003/06/03 02:56:06 millert Exp $
2.\"	$NetBSD: col.1,v 1.4 1995/03/26 05:25:52 glass Exp $
3.\"
4.\" Copyright (c) 1990, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" This code is derived from software contributed to Berkeley by
8.\" Michael Rendell.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\" 3. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)col.1	8.1 (Berkeley) 6/29/93
35.\"
36.Dd June 29, 1993
37.Dt COL 1
38.Os
39.Sh NAME
40.Nm col
41.Nd filter reverse line feeds from input
42.Sh SYNOPSIS
43.Nm col
44.Op Fl bfhx
45.Op Fl l Ar num
46.Sh DESCRIPTION
47.Nm
48filters out reverse (and half-reverse) line feeds so that the output is
49in the correct order with only forward and half-forward line
50feeds, and replaces whitespace characters with tabs where possible.
51This can be useful in processing the output of
52.Xr nroff 1
53and
54.Xr tbl 1 .
55.Pp
56.Nm
57reads from the standard input and writes to the standard output.
58.Pp
59The options are as follows:
60.Bl -tag -width Ds
61.It Fl b
62Do not output any backspaces, printing only the last character
63written to each column position.
64.It Fl f
65Forward half-line feeds are permitted
66.Pf ( Ns Dq fine
67mode).
68Normally characters printed on a half-line boundary are printed
69on the following line.
70.It Fl h
71Compress spaces into tabs.
72This is the default behavior.
73.It Fl x
74Output multiple spaces instead of tabs.
75.It Fl l Ar num
76Buffer at least
77.Ar num
78lines in memory.
79By default, 128 lines are buffered.
80.El
81.Pp
82The control sequences for carriage motion that
83.Nm
84understands and their decimal values are listed in the following
85table:
86.Pp
87.Bl -tag -width "carriage return" -compact
88.It ESC\-7
89Reverse line feed (escape then 7).
90.It ESC\-10
91Half reverse line feed (escape then 10).
92.It ESC\-11
93Half forward line feed (escape then 11).
94.It backspace
95Moves back one column (8); ignored in the first column.
96.It carriage return
97(13)
98.It newline
99Forward line feed (10); also does carriage return.
100.It shift in
101Shift to normal character set (15).
102.It shift out
103Shift to alternate character set (14).
104.It space
105Moves forward one column (32).
106.It tab
107Moves forward to next tab stop (9).
108.It vertical tab
109Reverse line feed (11).
110.El
111.Pp
112All unrecognized control characters and escape sequences are
113discarded.
114.Pp
115.Nm
116keeps track of the character set as characters are read and makes
117sure the character set is correct when they are output.
118.Pp
119If the input attempts to back up to the last flushed line,
120.Nm
121will display a warning message.
122.Sh SEE ALSO
123.Xr expand 1 ,
124.Xr nroff 1 ,
125.Xr tbl 1
126.Sh HISTORY
127A
128.Nm
129command appeared in
130.At v6 .
131