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