getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man1 / tabs.1
blob305c91ad98cffe7b4d03d13b4fec0fdef8caa004
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 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
45 .\" Portions Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved
46 .\"
47 .TH TABS 1 "Feb 1, 1995"
48 .SH NAME
49 tabs \- set tabs on a terminal
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fBtabs\fR [\fB-n\fR | \(mi\(mi\fIfile\fR
54       [[\fB-code\fR] | \fB-a\fR | \fB-a2\fR | \fB-c\fR | \fB-c2\fR | \fB-c3\fR | \fB-f\fR | \fB-p\fR | \fB-s\fR | \fB-u\fR]]
55       q!! [+m [\fIn\fR]] [\fB-T\fR \fItype\fR]
56 .fi
58 .LP
59 .nf
60 \fBtabs\fR [\fB-T\fR \fItype\fR] [+ \fIm\fR [\fIn\fR]] \fIn1\fR [, \fIn2\fR ,...]
61 .fi
63 .SH DESCRIPTION
64 .sp
65 .LP
66 The \fBtabs\fR utility sets the tab stops on the user's terminal according to a
67 tab specification, after clearing any previous settings. The user's terminal
68 must have remotely settable hardware tabs.
69 .SH OPTIONS
70 .sp
71 .LP
72 The following options are supported. If a given flag occurs more than once, the
73 last value given takes effect:
74 .sp
75 .ne 2
76 .na
77 \fB\fB-T\fR \fItype\fR \fR
78 .ad
79 .RS 12n
80 \fBtabs\fR needs to know the type of terminal in order to set tabs and margins.
81 \fItype\fR is a name listed in \fBterm\fR(5). If no \fB-T\fR flag is supplied,
82 \fBtabs\fR uses the value of the environment variable \fBTERM\fR. If the value
83 of \fBTERM\fR is \fINULL\fR or \fBTERM\fR is not defined in the environment
84 (see \fBenviron\fR(5)), \fBtabs\fR uses \fBansi+tabs\fR as the terminal type to
85 provide a sequence that will work for many terminals.
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fB+m[\fR\fIn\fR\fB]\fR \fR
92 .ad
93 .RS 12n
94 The margin argument may be used for some terminals. It causes all tabs to be
95 moved over \fIn\fR columns by making column \fIn\fR\fB+1\fR the left margin.
96 If \fB+m\fR is given without a value of \fIn\fR, the value assumed is \fB10\fR.
97 For a TermiNet, the first value in the tab list should be \fB1\fR, or the
98 margin will move even further to the right. The normal (leftmost) margin on
99 most terminals is obtained by \fB+m0\fR. The margin for most terminals is reset
100 only when the \fB+m\fR flag is given explicitly.
103 .SS "Tab Specification"
106 Four types of tab specification are accepted.  They are described below:
107 canned, repetitive (\fB-\fR\fIn\fR), arbitrary (\fIn1,n2,...\fR), and file
108 (\fB-\fR\fIfile\fR).
111 If no tab specification is given, the default value is \fB\(mi8\fR, that is,
112 UNIX system ``standard'' tabs. The lowest column number is \fB1\fR. Note:  For
113 \fBtabs\fR, column 1 always refers to the leftmost column on a terminal, even
114 one whose column markers begin at 0, for example, the DASI 300, DASI 300s, and
115 DASI 450.
116 .SS "\fICanned\fR \fB-code\fR"
119 Use one of the codes listed below to select a canned set of tabs. If more than
120 one code is specified, the last code option will be used.  The legal codes and
121 their meanings are as follows:
123 .ne 2
125 \fB\fB-a\fR\fR
127 .RS 7n
128 \fB1,10,16,36,72\fR Assembler, IBM S/370, first format
132 .ne 2
134 \fB\fB-a2\fR\fR
136 .RS 7n
137 \fB1,10,16,40,72\fR
139 Assembler, IBM S/370, second format
143 .ne 2
145 \fB\fB-c\fR\fR
147 .RS 7n
148 \fB1,8,12,16,20,55\fR
150 COBOL, normal format
154 .ne 2
156 \fB\fB-c2\fR\fR
158 .RS 7n
159 \fB1,6,10,14,49\fR
161 COBOL compact format (columns 1-6 omitted). Using this code, the first typed
162 character corresponds to card column 7, one space gets you to column 8, and a
163 tab reaches column 12. Files using this tab setup should include a format
164 specification as follows (see \fBfspec\fR(4)):
166 .in +2
168 <:t\fB-c2\fR \|m6 \|s66 \|d:>
170 .in -2
175 .ne 2
177 \fB\fB-c3\fR\fR
179 .RS 7n
180 \fB1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67\fR
182 COBOL compact format (columns 1-6 omitted), with more tabs than
183 \fB\fR\fB-c2\fR\fB\&.\fR This is the recommended format for COBOL. The
184 appropriate format specification is (see \fBfspec\fR(4)):
186 .in +2
188 <:t\fB-c3\fR \|m6 \|s66 \|d:>
190 .in -2
195 .ne 2
197 \fB\fB-f\fR\fR
199 .RS 7n
200 \fB1,7,11,15,19,23\fR
202 FORTRAN
206 .ne 2
208 \fB\fB-p\fR\fR
210 .RS 7n
211 \fB1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61\fR
213 PL/I
217 .ne 2
219 \fB\fB-s\fR\fR
221 .RS 7n
222 \fB1,10,55\fR
224 SNOBOL
228 .ne 2
230 \fB\fB-u\fR\fR
232 .RS 7n
233 \fB1,12,20,44\fR
235 UNIVAC 1100 Assembler
238 .SS "\fIRepetitive\fR"
240 .ne 2
242 \fB\fB-\fR\fIn\fR \fR
244 .RS 7n
245 A \fIrepetitive\fR specification requests tabs at columns 1+\fIn\fR,
246 1+2*\fIn\fR, etc., where \fIn\fR is a single-digit decimal number. Of
247 particular importance is the value \fB8\fR: this represents the UNIX system
248 ``standard'' tab setting, and is the most likely tab setting to be found at a
249 terminal. When \fB\(mi0\fR is used, the tab stops are cleared and no new ones
250 are set.
253 .SS "\fIArbitrary\fR"
256 See OPERANDS.
257 .SS "\fIFile\fR"
259 .ne 2
261 \fB\fB-\fR\fIfile\fR\fR
263 .RS 9n
264 If the name of a \fIfile\fR is given, \fBtabs\fR reads the first line of the
265 file, searching for a format specification (see \fBfspec\fR(4)). If it finds
266 one there, it sets the tab stops according to it, otherwise it sets them as
267 \fB\(mi8\fR\&. This type of specification may be used to make sure that a
268 tabbed file is printed with correct tab settings, and would be used with the
269 \fBpr\fR command:
271 .in +2
273 example% \fBtabs -\fI file\fR; pr\fI file\fR\fR
275 .in -2
282 Tab and margin setting is performed via the standard output.
283 .SH OPERANDS
286 The following operand is supported:
288 .ne 2
290 \fB\fIn1\fR[,\fIn2\fR,\|.\|.\|.] \fR
292 .RS 22n
293 The \fIarbitrary\fR format consists of tab-stop values separated by commas or
294 spaces. The tab-stop values must be positive decimal integers in ascending
295 order. Up to 40 numbers are allowed. If any number (except the first one) is
296 preceded by a plus sign, it is taken as an increment to be added to the
297 previous value. Thus, the formats \fB1\fR,\fB10\fR,\fB20\fR,\fB30\fR, and
298 \fB1\fR,\fB10\fR,\fB+10\fR,\fB+10\fR are considered identical.
301 .SH EXAMPLES
303 \fBExample 1 \fRUsing the tabs command
306 The following command is an example using \fB-code\fR ( \fIcanned\fR
307 specification) to set tabs to the settings required by the IBM assembler:
308 columns 1, 10, 16, 36, 72:
311 .in +2
313 example% \fBtabs -a\fR
315 .in -2
320 The next command is an example of using \fB-n\fR (\fIrepetitive\fR
321 specification), where \fIn\fR is \fB8\fR, causes tabs to be set every eighth
322 position: 1+(1*8), 1+(2*8), .\|.\|.\| which evaluate to columns 9,
323 17, .\|.\|.\|:
326 .in +2
328 example% \fBtabs \(mi8\fR
330 .in -2
335 This command uses \fIn1\fR,\fIn2\fR,.\|.\|.\| (\fIarbitrary\fR specification)
336 to set tabs at columns 1, 8, and 36:
339 .in +2
341 example% \fBtabs 1,8,36\fR
343 .in -2
348 The last command is an example of using \fI-file\fR (\fBfile\fR specification)
349 to indicate that tabs should be set according to the first line of
350 $\fBHOME\fR/fspec.list/att4425  (see \fBfspec\fR(4)).
353 .in +2
355 example% \fBtabs -$HOME/fspec.list/att4425\fR
357 .in -2
360 .SH ENVIRONMENT VARIABLES
363 See \fBenviron\fR(5) for descriptions of the following environment variables
364 that affect the execution of \fBtabs\fR: \fBLANG\fR, \fBLC_ALL\fR,
365 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
367 .ne 2
369 \fB\fBTERM\fR \fR
371 .RS 9n
372 Determine the terminal type. If this variable is unset or null, and if the
373 \fB-T\fR option is not specified, terminal type \fBansi+tabs\fR will be used.
376 .SH EXIT STATUS
379 The following exit values are returned:
381 .ne 2
383 \fB\fB0\fR \fR
385 .RS 7n
386 Successful completion.
390 .ne 2
392 \fB\fB>0\fR \fR
394 .RS 7n
395 An error occurred.
398 .SH ATTRIBUTES
401 See \fBattributes\fR(5) for descriptions of the following attributes:
406 box;
407 c | c
408 l | l .
409 ATTRIBUTE TYPE  ATTRIBUTE VALUE
411 CSI     Enabled
413 Interface Stability     Standard
416 .SH SEE ALSO
419 \fBexpand\fR(1), \fBnewform\fR(1), \fBpr\fR(1), \fBstty\fR(1), \fBtput\fR(1),
420 \fBfspec\fR(4), \fBterminfo\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
421 \fBterm\fR(5), \fBstandards\fR(5)
422 .SH NOTES
425 There is no consistency among different terminals regarding ways of clearing
426 tabs and setting the left margin.
429 \fBtabs\fR clears only \fB20\fR tabs (on terminals requiring a long sequence),
430 but is willing to set \fB64\fR.
433 The \fItabspec\fR used with the \fBtabs\fR command is different from the one
434 used with the \fBnewform\fR command. For example, \fBtabs\fR \fB\(mi8\fR sets
435 every eighth position; whereas \fBnewform\fR \fB\(mii\(mi8\fR indicates that
436 tabs are set every eighth position.