xref: /freebsd/usr.bin/col/col.1 (revision 38f0b757fd84d17d0fc24739a7cda160c4516d81)
1.\" Copyright (c) 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Michael Rendell.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 4. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)col.1	8.1 (Berkeley) 6/29/93
32.\" $FreeBSD$
33.\"
34.Dd August 4, 2004
35.Dt COL 1
36.Os
37.Sh NAME
38.Nm col
39.Nd filter reverse line feeds from input
40.Sh SYNOPSIS
41.Nm
42.Op Fl bfhpx
43.Op Fl l Ar num
44.Sh DESCRIPTION
45The
46.Nm
47utility filters out reverse (and half reverse) line feeds so that the output is
48in the correct order with only forward and half forward line
49feeds, and replaces white-space characters with tabs where possible.
50This can be useful in processing the output of
51.Xr nroff 1
52and
53.Xr tbl 1 .
54.Pp
55The
56.Nm
57utility reads from the standard input and writes to the standard output.
58.Pp
59The options are as follows:
60.Bl -tag -width indent
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 (``fine'' mode).
66Normally characters printed on a half line boundary are printed
67on the following line.
68.It Fl h
69Do not output multiple spaces instead of tabs (default).
70.It Fl l Ar num
71Buffer at least
72.Ar num
73lines in memory.
74By default, 128 lines are buffered.
75.It Fl p
76Force unknown control sequences to be passed through unchanged.
77Normally,
78.Nm
79will filter out any control sequences from the input other than those
80recognized and interpreted by itself, which are listed below.
81.It Fl x
82Output multiple spaces instead of tabs.
83.El
84.Pp
85The control sequences for carriage motion that
86.Nm
87understands and their decimal values are listed in the following
88table:
89.Pp
90.Bl -tag -width "carriage return" -compact
91.It ESC\-7
92reverse line feed (escape then 7)
93.It ESC\-8
94half reverse line feed (escape then 8)
95.It ESC\-9
96half forward line feed (escape then 9)
97.It backspace
98moves back one column (8); ignored in the first column
99.It carriage return
100(13)
101.It newline
102forward line feed (10); also does carriage return
103.It shift in
104shift to normal character set (15)
105.It shift out
106shift to alternate character set (14)
107.It space
108moves forward one column (32)
109.It tab
110moves forward to next tab stop (9)
111.It vertical tab
112reverse line feed (11)
113.El
114.Pp
115All unrecognized control characters and escape sequences are
116discarded.
117.Pp
118The
119.Nm
120utility keeps 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 ENVIRONMENT
127The
128.Ev LANG , LC_ALL
129and
130.Ev LC_CTYPE
131environment variables affect the execution of
132.Nm
133as described in
134.Xr environ 7 .
135.Sh EXIT STATUS
136.Ex -std
137.Sh SEE ALSO
138.Xr colcrt 1 ,
139.Xr expand 1 ,
140.Xr nroff 1 ,
141.Xr tbl 1
142.Sh STANDARDS
143The
144.Nm
145utility conforms to
146.St -susv2 .
147.Sh HISTORY
148A
149.Nm
150command
151appeared in
152.At v6 .
153