Unleashed v1.4
[unleashed.git] / share / man / man1 / col.1
blob5e7da1a4d2e0d9dc6d57bc7ac252eaf42dd685a4
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
45 .\" Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH COL 1 "Feb 1, 1995"
48 .SH NAME
49 col \- reverse line-feeds filter
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fBcol\fR [\fB-bfpx\fR]
54 .fi
56 .SH DESCRIPTION
57 .sp
58 .LP
59 The \fBcol\fR utility reads from the standard input and writes to the standard
60 output. It performs the line overlays implied by reverse line-feeds, and by
61 forward and reverse half-line-feeds. Unless \fB-x\fR is used, all blank
62 characters in the input will be converted to tab characters wherever possible.
63 \fBcol\fR is particularly useful for filtering multi-column output made with
64 the \fB\&.rt\fR command of \fBnroff\fR(1) and output resulting from use of the
65 \fBtbl\fR(1) preprocessor.
66 .sp
67 .LP
68 The \fBASCII\fR control characters \fBSO\fR and \fBSI\fR are assumed by
69 \fBcol\fR to start and end text in an alternative character set. The character
70 set to which each input character belongs is remembered, and on output \fBSI\fR
71 and \fBSO\fR characters are generated as appropriate to ensure that each
72 character is written in the correct character set.
73 .sp
74 .LP
75 On input, the only control characters accepted are space, backspace, tab,
76 carriage-return and newline characters, \fBSI,\fR \fBSO,\fR \fBVT,\fR reverse
77 line-feed, forward half-line-feed and reverse half-line-feed. The \fBVT\fR
78 character is an alternative form of full reverse line-feed, included for
79 compatibility with some earlier programs of this type. The only other
80 characters to be copied to the output are those that are printable.
81 .sp
82 .LP
83 The \fBASCII\fR codes for the control functions and line-motion sequences
84 mentioned above are as given in the table below. \fBESC\fR stands for the
85 \fBASCII\fR escape character, with the octal code 033; \fBESC\fR\fB\(mi\fR
86 means a sequence of two characters, \fBESC\fR followed by the character
87 \fBx\fR.
88 .sp
90 .sp
91 .TS
92 l l
93 l l .
94 reverse line-feed       ESC\(mi7
95 reverse half-line-feed  ESC\(mi8
96 forward half-line-feed  ESC\(mi9
97 vertical-tab (VT)       013
98 start-of-text (SO)      016
99 end-of-text (SI)        017
102 .SH OPTIONS
104 .ne 2
106 \fB\fB-b\fR\fR
108 .RS 7n
109 Assume that the output device in use is not capable of backspacing. In this
110 case, if two or more characters are to appear in the same place, only the last
111 one read will be output.
115 .ne 2
117 \fB\fB-f\fR \fR
119 .RS 7n
120 Although \fBcol\fR accepts half-line motions in its input, it normally does not
121 emit them on output. Instead, text that would appear between lines is moved to
122 the next lower full-line boundary. This treatment can be suppressed by the
123 \fB-f\fR (fine) option; in this case, the output from \fBcol\fR may contain
124 forward half-line-feeds (ESC-9), but will still never contain either kind of
125 reverse line motion.
129 .ne 2
131 \fB\fB-p\fR \fR
133 .RS 7n
134 Normally, \fBcol\fR will ignore any escape sequences unknown to it that are
135 found in its input; the \fB-p\fR option may be used to cause \fBcol\fR to
136 output these sequences as regular characters, subject to overprinting from
137 reverse line motions. The use of this option is highly discouraged unless the
138 user is fully aware of the textual position of the escape sequences.
142 .ne 2
144 \fB\fB-x\fR \fR
146 .RS 7n
147 Prevent \fBcol\fR from converting blank characters to tab characters on output
148 wherever possible. Tab stops are considered to be at each column position
149 \fIn\fR such that \fIn\fR modulo 8 equals 1.
152 .SH ENVIRONMENT VARIABLES
155 See \fBenviron\fR(5) for descriptions of the following environment variables
156 that affect the execution of \fBcol\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and
157 \fBNLSPATH\fR.
158 .SH EXIT STATUS
161 The following error values are returned:
163 .ne 2
165 \fB\fB0\fR \fR
167 .RS 7n
168 Successful completion.
172 .ne 2
174 \fB\fB>0\fR \fR
176 .RS 7n
177 An error occurred.
180 .SH ATTRIBUTES
183 See \fBattributes\fR(5) for descriptions of the following attributes:
188 box;
189 c | c
190 l | l .
191 ATTRIBUTE TYPE  ATTRIBUTE VALUE
192 CSI     enabled
195 .SH SEE ALSO
198 \fBnroff\fR(1), \fBtbl\fR(1), \fBascii\fR(5), \fBattributes\fR(5),
199 \fBenviron\fR(5)
200 .SH NOTES
203 The input format accepted by \fBcol\fR matches the output produced by
204 \fBnroff\fR with either the \fB-T37\fR or \fB-Tlp\fR options. Use \fB-T37\fR
205 (and the \fB-f\fR option of \fBcol\fR) if the ultimate disposition of the
206 output of \fBcol\fR will be a device that can interpret half-line motions, and
207 \fB-Tlp\fR otherwise.
210 \fBcol\fR cannot back up more than 128 lines or handle more than 800 characters
211 per line.
214 Local vertical motions that would result in backing up over the first line of
215 the document are ignored. As a result, the first line must not have any
216 superscripts.