xref: /netbsd/usr.bin/col/col.1 (revision bf9ec67e)
1.\"	$NetBSD: col.1,v 1.8 2001/12/01 16:43:10 wiz 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 February 22, 1999
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
47.Op Fl bfpx
48.Op Fl l Ar num
49.Sh DESCRIPTION
50.Nm
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
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 p
72Force unknown control sequences to be passed through unchanged.
73Normally,
74.Nm
75will filter out any control sequences from the input other than those
76recognized and interpreted by itself, which are listed below.
77.It Fl x
78Output multiple spaces instead of tabs.
79.It Fl l Ar num
80Buffer at least
81.Ar num
82lines in memory.
83By default, 128 lines are buffered.
84.El
85.Pp
86The control sequences for carriage motion that
87.Nm
88understands and their decimal values are listed in the following
89table:
90.Pp
91.Bl -tag -width "carriage return" -compact
92.It ESC\-7
93reverse line feed (escape then 7)
94.It ESC\-8
95half reverse line feed (escape then 8)
96.It ESC\-9
97half forward line feed (escape then 9)
98.It backspace
99moves back one column (8); ignored in the first column
100.It carriage return
101(13)
102.It newline
103forward line feed (10); also does carriage return
104.It shift in
105shift to normal character set (15)
106.It shift out
107shift to alternative character set (14)
108.It space
109moves forward one column (32)
110.It tab
111moves forward to next tab stop (9)
112.It vertical tab
113reverse line feed (11)
114.El
115.Pp
116All unrecognized control characters and escape sequences are
117discarded.
118.Pp
119.Nm
120keeps track of the character set as characters are read and makes
121sure the character set is correct when they are output.
122.Pp
123If the input attempts to back up to the last flushed line,
124.Nm
125will display a warning message.
126.Sh SEE ALSO
127.Xr expand 1 ,
128.Xr nroff 1 ,
129.Xr tbl 1
130.Sh STANDARDS
131The
132.Nm
133utility conforms to
134.St -xpg4.2 .
135The
136.Fl l
137option is an extension to the standard.
138.Sh HISTORY
139A
140.Nm
141command appeared in
142.At v6 .
143