]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.bin/col/col.1
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / usr.bin / col / col.1
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 May 10, 2015
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
45 The
46 .Nm
47 utility filters out reverse (and half reverse) line feeds so that the output is
48 in the correct order with only forward and half forward line
49 feeds, and replaces white-space characters with tabs where possible.
50 This can be useful in processing the output of
51 .Xr nroff 1
52 and
53 .Xr tbl 1 .
54 .Pp
55 The
56 .Nm
57 utility reads from the standard input and writes to the standard output.
58 .Pp
59 The options are as follows:
60 .Bl -tag -width indent
61 .It Fl b
62 Do not output any backspaces, printing only the last character
63 written to each column position.
64 .It Fl f
65 Forward half line feeds are permitted (``fine'' mode).
66 Normally characters printed on a half line boundary are printed
67 on the following line.
68 .It Fl h
69 Do not output multiple spaces instead of tabs (default).
70 .It Fl l Ar num
71 Buffer at least
72 .Ar num
73 lines in memory.
74 By default, 128 lines are buffered.
75 .It Fl p
76 Force unknown control sequences to be passed through unchanged.
77 Normally,
78 .Nm
79 will filter out any control sequences from the input other than those
80 recognized and interpreted by itself, which are listed below.
81 .It Fl x
82 Output multiple spaces instead of tabs.
83 .El
84 .Pp
85 In the input stream,
86 .Nm
87 understands both the escape sequences of the form escape-digit
88 mandated by
89 .St -susv2
90 and the traditional
91 .Bx
92 format escape-control-character.
93 The control sequences for carriage motion and their ASCII values
94 are as follows:
95 .Pp
96 .Bl -tag -width "carriage return" -compact
97 .It ESC\-BELL
98 reverse line feed (escape then bell).
99 .It ESC\-7
100 reverse line feed (escape then 7).
101 .It ESC\-BACKSPACE
102 half reverse line feed (escape then backspace).
103 .It ESC\-8
104 half reverse line feed (escape then 8).
105 .It ESC\-TAB
106 half forward line feed (escape than tab).
107 .It ESC\-9
108 half forward line feed (escape then 9).
109 In
110 .Fl f
111 mode, this sequence may also occur in the output stream.
112 .It backspace
113 moves back one column (8); ignored in the first column
114 .It carriage return
115 (13)
116 .It newline
117 forward line feed (10); also does carriage return
118 .It shift in
119 shift to normal character set (15)
120 .It shift out
121 shift to alternate character set (14)
122 .It space
123 moves forward one column (32)
124 .It tab
125 moves forward to next tab stop (9)
126 .It vertical tab
127 reverse line feed (11)
128 .El
129 .Pp
130 All unrecognized control characters and escape sequences are
131 discarded.
132 .Pp
133 The
134 .Nm
135 utility keeps track of the character set as characters are read and makes
136 sure the character set is correct when they are output.
137 .Pp
138 If the input attempts to back up to the last flushed line,
139 .Nm
140 will display a warning message.
141 .Sh ENVIRONMENT
142 The
143 .Ev LANG , LC_ALL
144 and
145 .Ev LC_CTYPE
146 environment variables affect the execution of
147 .Nm
148 as described in
149 .Xr environ 7 .
150 .Sh EXIT STATUS
151 .Ex -std
152 .Sh SEE ALSO
153 .Xr colcrt 1 ,
154 .Xr expand 1 ,
155 .Xr nroff 1 ,
156 .Xr tbl 1
157 .Sh STANDARDS
158 The
159 .Nm
160 utility conforms to
161 .St -susv2 .
162 .Sh HISTORY
163 A
164 .Nm
165 command
166 appeared in
167 .At v6 .