1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
.\"
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
.\" permission to reproduce portions of its copyrighted documentation.
.\" Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\"
.\" The Institute of Electrical and Electronics Engineers and The Open
.\" Group, have given us permission to reprint portions of their
.\" documentation.
.\"
.\" In the following statement, the phrase ``this text'' refers to portions
.\" of the system documentation.
.\"
.\" Portions of this text are reprinted and reproduced in electronic form
.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
.\" Standard for Information Technology -- Portable Operating System
.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
.\" Engineers, Inc and The Open Group. In the event of any discrepancy
.\" between these versions and the original IEEE and The Open Group
.\" Standard, the original IEEE and The Open Group Standard is the referee
.\" document. The original Standard can be obtained online at
.\" http://www.opengroup.org/unix/online.html.
.\"
.\" This notice shall appear on any product containing this material.
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\"
.\" Copyright 1989 AT&T
.\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
.\" Portions Copyright (c) 1995, Sun Microsystems, Inc. All Rights Reserved
.\"
.TH TABS 1 "Feb 1, 1995"
.SH NAME
tabs \- set tabs on a terminal
.SH SYNOPSIS
.LP
.nf
\fBtabs\fR [\fB-n\fR | \(mi\(mi\fIfile\fR
[[\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]]
q!! [+m [\fIn\fR]] [\fB-T\fR \fItype\fR]
.fi
.LP
.nf
\fBtabs\fR [\fB-T\fR \fItype\fR] [+ \fIm\fR [\fIn\fR]] \fIn1\fR [, \fIn2\fR ,...]
.fi
.SH DESCRIPTION
.sp
.LP
The \fBtabs\fR utility sets the tab stops on the user's terminal according to a
tab specification, after clearing any previous settings. The user's terminal
must have remotely settable hardware tabs.
.SH OPTIONS
.sp
.LP
The following options are supported. If a given flag occurs more than once, the
last value given takes effect:
.sp
.ne 2
.na
\fB\fB-T\fR \fItype\fR \fR
.ad
.RS 12n
\fBtabs\fR needs to know the type of terminal in order to set tabs and margins.
\fItype\fR is a name listed in \fBterm\fR(7). If no \fB-T\fR flag is supplied,
\fBtabs\fR uses the value of the environment variable \fBTERM\fR. If the value
of \fBTERM\fR is \fINULL\fR or \fBTERM\fR is not defined in the environment
(see \fBenviron\fR(7)), \fBtabs\fR uses \fBansi+tabs\fR as the terminal type to
provide a sequence that will work for many terminals.
.RE
.sp
.ne 2
.na
\fB\fB+m[\fR\fIn\fR\fB]\fR \fR
.ad
.RS 12n
The margin argument may be used for some terminals. It causes all tabs to be
moved over \fIn\fR columns by making column \fIn\fR\fB+1\fR the left margin.
If \fB+m\fR is given without a value of \fIn\fR, the value assumed is \fB10\fR.
For a TermiNet, the first value in the tab list should be \fB1\fR, or the
margin will move even further to the right. The normal (leftmost) margin on
most terminals is obtained by \fB+m0\fR. The margin for most terminals is reset
only when the \fB+m\fR flag is given explicitly.
.RE
.SS "Tab Specification"
.sp
.LP
Four types of tab specification are accepted. They are described below:
canned, repetitive (\fB-\fR\fIn\fR), arbitrary (\fIn1,n2,...\fR), and file
(\fB-\fR\fIfile\fR).
.sp
.LP
If no tab specification is given, the default value is \fB\(mi8\fR, that is,
UNIX system ``standard'' tabs. The lowest column number is \fB1\fR. Note: For
\fBtabs\fR, column 1 always refers to the leftmost column on a terminal, even
one whose column markers begin at 0, for example, the DASI 300, DASI 300s, and
DASI 450.
.SS "\fICanned\fR \fB-code\fR"
.sp
.LP
Use one of the codes listed below to select a canned set of tabs. If more than
one code is specified, the last code option will be used. The legal codes and
their meanings are as follows:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 7n
\fB1,10,16,36,72\fR Assembler, IBM S/370, first format
.RE
.sp
.ne 2
.na
\fB\fB-a2\fR\fR
.ad
.RS 7n
\fB1,10,16,40,72\fR
.sp
Assembler, IBM S/370, second format
.RE
.sp
.ne 2
.na
\fB\fB-c\fR\fR
.ad
.RS 7n
\fB1,8,12,16,20,55\fR
.sp
COBOL, normal format
.RE
.sp
.ne 2
.na
\fB\fB-c2\fR\fR
.ad
.RS 7n
\fB1,6,10,14,49\fR
.sp
COBOL compact format (columns 1-6 omitted). Using this code, the first typed
character corresponds to card column 7, one space gets you to column 8, and a
tab reaches column 12. Files using this tab setup should include a format
specification as follows (see \fBfspec\fR(5)):
.sp
.in +2
.nf
<:t\fB-c2\fR \|m6 \|s66 \|d:>
.fi
.in -2
.RE
.sp
.ne 2
.na
\fB\fB-c3\fR\fR
.ad
.RS 7n
\fB1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67\fR
.sp
COBOL compact format (columns 1-6 omitted), with more tabs than
\fB\fR\fB-c2\fR\fB\&.\fR This is the recommended format for COBOL. The
appropriate format specification is (see \fBfspec\fR(5)):
.sp
.in +2
.nf
<:t\fB-c3\fR \|m6 \|s66 \|d:>
.fi
.in -2
.RE
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 7n
\fB1,7,11,15,19,23\fR
.sp
FORTRAN
.RE
.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 7n
\fB1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61\fR
.sp
PL/I
.RE
.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 7n
\fB1,10,55\fR
.sp
SNOBOL
.RE
.sp
.ne 2
.na
\fB\fB-u\fR\fR
.ad
.RS 7n
\fB1,12,20,44\fR
.sp
UNIVAC 1100 Assembler
.RE
.SS "\fIRepetitive\fR"
.sp
.ne 2
.na
\fB\fB-\fR\fIn\fR \fR
.ad
.RS 7n
A \fIrepetitive\fR specification requests tabs at columns 1+\fIn\fR,
1+2*\fIn\fR, etc., where \fIn\fR is a single-digit decimal number. Of
particular importance is the value \fB8\fR: this represents the UNIX system
``standard'' tab setting, and is the most likely tab setting to be found at a
terminal. When \fB\(mi0\fR is used, the tab stops are cleared and no new ones
are set.
.RE
.SS "\fIArbitrary\fR"
.sp
.LP
See OPERANDS.
.SS "\fIFile\fR"
.sp
.ne 2
.na
\fB\fB-\fR\fIfile\fR\fR
.ad
.RS 9n
If the name of a \fIfile\fR is given, \fBtabs\fR reads the first line of the
file, searching for a format specification (see \fBfspec\fR(5)). If it finds
one there, it sets the tab stops according to it, otherwise it sets them as
\fB\(mi8\fR\&. This type of specification may be used to make sure that a
tabbed file is printed with correct tab settings, and would be used with the
\fBpr\fR command:
.sp
.in +2
.nf
example% \fBtabs -\fI file\fR; pr\fI file\fR\fR
.fi
.in -2
.sp
.RE
.sp
.LP
Tab and margin setting is performed via the standard output.
.SH OPERANDS
.sp
.LP
The following operand is supported:
.sp
.ne 2
.na
\fB\fIn1\fR[,\fIn2\fR,\|.\|.\|.] \fR
.ad
.RS 22n
The \fIarbitrary\fR format consists of tab-stop values separated by commas or
spaces. The tab-stop values must be positive decimal integers in ascending
order. Up to 40 numbers are allowed. If any number (except the first one) is
preceded by a plus sign, it is taken as an increment to be added to the
previous value. Thus, the formats \fB1\fR,\fB10\fR,\fB20\fR,\fB30\fR, and
\fB1\fR,\fB10\fR,\fB+10\fR,\fB+10\fR are considered identical.
.RE
.SH EXAMPLES
.LP
\fBExample 1 \fRUsing the tabs command
.sp
.LP
The following command is an example using \fB-code\fR ( \fIcanned\fR
specification) to set tabs to the settings required by the IBM assembler:
columns 1, 10, 16, 36, 72:
.sp
.in +2
.nf
example% \fBtabs -a\fR
.fi
.in -2
.sp
.sp
.LP
The next command is an example of using \fB-n\fR (\fIrepetitive\fR
specification), where \fIn\fR is \fB8\fR, causes tabs to be set every eighth
position: 1+(1*8), 1+(2*8), .\|.\|.\| which evaluate to columns 9,
17, .\|.\|.\|:
.sp
.in +2
.nf
example% \fBtabs \(mi8\fR
.fi
.in -2
.sp
.sp
.LP
This command uses \fIn1\fR,\fIn2\fR,.\|.\|.\| (\fIarbitrary\fR specification)
to set tabs at columns 1, 8, and 36:
.sp
.in +2
.nf
example% \fBtabs 1,8,36\fR
.fi
.in -2
.sp
.sp
.LP
The last command is an example of using \fI-file\fR (\fBfile\fR specification)
to indicate that tabs should be set according to the first line of
$\fBHOME\fR/fspec.list/att4425 (see \fBfspec\fR(5)).
.sp
.in +2
.nf
example% \fBtabs -$HOME/fspec.list/att4425\fR
.fi
.in -2
.sp
.SH ENVIRONMENT VARIABLES
.sp
.LP
See \fBenviron\fR(7) for descriptions of the following environment variables
that affect the execution of \fBtabs\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
.sp
.ne 2
.na
\fB\fBTERM\fR \fR
.ad
.RS 9n
Determine the terminal type. If this variable is unset or null, and if the
\fB-T\fR option is not specified, terminal type \fBansi+tabs\fR will be used.
.RE
.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR \fR
.ad
.RS 7n
Successful completion.
.RE
.sp
.ne 2
.na
\fB\fB>0\fR \fR
.ad
.RS 7n
An error occurred.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
CSI Enabled
_
Interface Stability Standard
.TE
.SH SEE ALSO
.sp
.LP
.BR expand (1),
.BR newform (1),
.BR pr (1),
.BR stty (1),
.BR tput (1),
.BR fspec (5),
.BR terminfo (5),
.BR attributes (7),
.BR environ (7),
.BR standards (7),
.BR term (7)
.SH NOTES
.sp
.LP
There is no consistency among different terminals regarding ways of clearing
tabs and setting the left margin.
.sp
.LP
\fBtabs\fR clears only \fB20\fR tabs (on terminals requiring a long sequence),
but is willing to set \fB64\fR.
.sp
.LP
The \fItabspec\fR used with the \fBtabs\fR command is different from the one
used with the \fBnewform\fR command. For example, \fBtabs\fR \fB\(mi8\fR sets
every eighth position; whereas \fBnewform\fR \fB\(mii\(mi8\fR indicates that
tabs are set every eighth position.
|