'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 1992, X/Open Company Limited  All Rights Reserved  Portions Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved
.\" 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 Sun OS 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]
.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(5). 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(5)), \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(4)):
.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(4)):
.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(4)). 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(4)).

.sp
.in +2
.nf
example% \fBtabs -$HOME/fspec.list/att4425\fR
.fi
.in -2
.sp

.SH ENVIRONMENT VARIABLES
.sp
.LP
See \fBenviron\fR(5) 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(5) 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
\fBexpand\fR(1), \fBnewform\fR(1), \fBpr\fR(1), \fBstty\fR(1), \fBtput\fR(1),
\fBfspec\fR(4), \fBterminfo\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
\fBterm\fR(5), \fBstandards\fR(5)
.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.