Blob Blame History Raw
'\" et
.TH TABS "1P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.

.SH NAME
tabs
\(em set terminal tabs
.SH SYNOPSIS
.LP
.nf
tabs \fB[\fR\(mi\fIn\fP|\(mia|\(mia2|\(mic|\(mic2|\(mic3|\(mif|\(mip|\(mis|\(miu\fB] [\fR\(miT \fItype\fB]\fR
.P
tabs \fB[\fR\(miT \fItype\fB] \fIn\fB[[\fIsep\fB[\fR+\fB]\fIn\fB]\fR...\fB]\fR
.fi
.SH DESCRIPTION
The
.IR tabs
utility shall display a series of characters that first clears the
hardware terminal tab settings and then initializes the tab stops at
the specified positions
and optionally adjusts the margin.
.P
The phrase ``tab-stop position
.IR N ''
shall be taken to mean that, from the start of a line of output,
tabbing to position
.IR N
shall cause the next character output to be in the (\c
.IR N +1)th
column position on that line. The maximum number of tab stops allowed
is terminal-dependent.
.P
It need not be possible to implement
.IR tabs
on certain terminals. If the terminal type obtained from the
.IR TERM
environment variable or
.BR \(miT
option represents such a terminal, an appropriate diagnostic message
shall be written to standard error and
.IR tabs
shall exit with a status greater than zero.
.SH OPTIONS
The
.IR tabs
utility shall conform to the Base Definitions volume of POSIX.1\(hy2008,
.IR "Section 12.2" ", " "Utility Syntax Guidelines",
except for various extensions: the options
.BR \(mia2 ,
.BR \(mic2 ,
and
.BR \(mic3
are multi-character.
.P
The following options shall be supported:
.IP "\fB\(mi\fIn\fR" 10
Specify repetitive tab stops separated by a uniform number of column
positions,
.IR n ,
where
.IR n
is a single-digit decimal number. The default usage of
.IR tabs
with no arguments shall be equivalent to
.IR tabs
\(mi8. When
.BR \(mi0
is used, the tab stops shall be cleared and no new ones set.
.IP "\fB\(mia\fP" 10
1,10,16,36,72
.br
Assembler, applicable to some mainframes.
.IP "\fB\(mia2\fP" 10
1,10,16,40,72
.br
Assembler, applicable to some mainframes.
.IP "\fB\(mic\fP" 10
1,8,12,16,20,55
.br
COBOL, normal format.
.IP "\fB\(mic2\fP" 10
1,6,10,14,49
.br
COBOL, compact format (columns 1 to 6 omitted).
.IP "\fB\(mic3\fP" 10
1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67
.br
COBOL compact format (columns 1 to 6 omitted), with more tabs than
.BR \(mic2 .
.IP "\fB\(mif\fP" 10
1,7,11,15,19,23
.br
FORTRAN
.IP "\fB\(mip\fP" 10
1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61
.br
PL/1
.IP "\fB\(mis\fP" 10
1,10,55
.br
SNOBOL
.IP "\fB\(miu\fP" 10
1,12,20,44
.br
Assembler, applicable to some mainframes.
.IP "\fB\(miT\ \fItype\fR" 10
Indicate the type of terminal. If this option is not supplied and the
.IR TERM
variable is unset or null, an unspecified default terminal type shall
be used. The setting of
.IR type
shall take precedence over the value in
.IR TERM .
.SH OPERANDS
The following operand shall be supported:
.IP "\fIn\fB[[\fIsep\fB[\fR+\fB]\fIn\fB]\fR...\fB]\fR" 10
A single command line argument that consists of one or more tab-stop
values (\c
.IR n )
separated by a separator character (\c
.IR sep )
which is either a
<comma>
or a
<blank>
character. The application shall ensure that the tab-stop values are
positive decimal integers in strictly ascending order. If any tab-stop
value (except the first one) is preceded by a
<plus-sign>,
it is taken as an increment to be added to the previous value. For
example, the tab lists 1,10,20,30 and
.BR \(dq1 10 +10 +10\(dq 
are considered to be identical.
.SH STDIN
Not used.
.SH "INPUT FILES"
None.
.SH "ENVIRONMENT VARIABLES"
The following environment variables shall affect the execution of
.IR tabs :
.IP "\fILANG\fP" 10
Provide a default value for the internationalization variables that are
unset or null. (See the Base Definitions volume of POSIX.1\(hy2008,
.IR "Section 8.2" ", " "Internationalization Variables"
for the precedence of internationalization variables used to determine
the values of locale categories.)
.IP "\fILC_ALL\fP" 10
If set to a non-empty string value, override the values of all the
other internationalization variables.
.IP "\fILC_CTYPE\fP" 10
Determine the locale for the interpretation of sequences of bytes of
text data as characters (for example, single-byte as opposed to
multi-byte characters in arguments).
.IP "\fILC_MESSAGES\fP" 10
.br
Determine the locale that should be used to affect the format and
contents of diagnostic messages written to standard error.
.IP "\fINLSPATH\fP" 10
Determine the location of message catalogs for the processing of
.IR LC_MESSAGES .
.IP "\fITERM\fP" 10
Determine the terminal type. If this variable is unset or null, and if
the
.BR \(miT
option is not specified, an unspecified default terminal type shall be
used.
.SH "ASYNCHRONOUS EVENTS"
Default.
.SH STDOUT
If standard output is a terminal, the appropriate sequence to clear and
set the tab stops may be written to standard output in an unspecified
format. If standard output is not a terminal, undefined results
occur.
.SH STDERR
The standard error shall be used only for diagnostic messages.
.SH "OUTPUT FILES"
None.
.SH "EXTENDED DESCRIPTION"
None.
.SH "EXIT STATUS"
The following exit values shall be returned:
.IP "\00" 6
Successful completion.
.IP >0 6
An error occurred.
.SH "CONSEQUENCES OF ERRORS"
Default.
.LP
.IR "The following sections are informative."
.SH "APPLICATION USAGE"
This utility makes use of the terminal's hardware tabs and the
.IR stty
.IR tabs
option.
.P
This utility is not recommended for application use.
.P
Some integrated display units might not have escape sequences to set
tab stops, but may be set by internal system calls. On these
terminals,
.IR tabs
works if standard output is directed to the terminal; if output is
directed to another file, however,
.IR tabs
fails.
.SH EXAMPLES
None.
.SH RATIONALE
Consideration was given to having the
.IR tput
utility handle all of the functions described in
.IR tabs .
However, the separate
.IR tabs
utility was retained because it seems more intuitive to use a command
named
.IR tabs
than
.IR tput
with a new option. The
.IR tput
utility does not support setting or clearing tabs, and no known
historical version of
.IR tabs
supports the capability of setting arbitrary tab stops.
.P
The System V
.IR tabs
interface is very complex; the version in this volume of POSIX.1\(hy2008 has a reduced feature
list, but many of the features omitted were restored as part of the
XSI option even though the supported languages and coding styles are
primarily historical.
.P
There was considerable sentiment for specifying only a means of
resetting the tabs back to a known state\(empresumably the ``standard''
of tabs every eight positions. The following features were omitted:
.IP " *" 4
Setting tab stops via the first line in a file, using \(mi\|\(mi\c
.IR file .
Since even the SVID has no complete explanation of this feature, it is
doubtful that it is in widespread use.
.P
In an early proposal, a
.BR \(mit
.IR tablist
option was added for consistency with
.IR expand ;
this was later removed when inconsistencies with the historical list of
tabs were identified.
.P
Consideration was given to adding a
.BR \(mip
option that would output the current tab settings so that they could be
saved and then later restored. This was not accepted because querying
the tab stops of the terminal is not a capability in historical
.IR terminfo
or
.IR termcap
facilities and might not be supported on a wide range of terminals.
.SH "FUTURE DIRECTIONS"
None.
.SH "SEE ALSO"
.IR "\fIexpand\fR\^",
.IR "\fIstty\fR\^",
.IR "\fItput\fR\^",
.IR "\fIunexpand\fR\^"
.P
The Base Definitions volume of POSIX.1\(hy2008,
.IR "Chapter 8" ", " "Environment Variables",
.IR "Section 12.2" ", " "Utility Syntax Guidelines"
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 7, Copyright (C) 2013 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
event of any discrepancy between this version 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.unix.org/online.html .

Any typographical or formatting errors that appear
in this page are most likely
to have been introduced during the conversion of the source files to
man page format. To report such errors, see
https://www.kernel.org/doc/man-pages/reporting_bugs.html .