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