# tabs

## 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.
    


## NAME



           tabs — set terminal tabs
    


## SYNOPSIS



           tabs **[** -_n_ |-a|-a2|-c|-c2|-c3|-f|-p|-s|-u**] [** -T _type_**]**
    
           tabs **[** -T _type_**]**_n_**[[**_sep_**[** +**]**_n_**]**...**]**
    


## DESCRIPTION



           The _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.
    
           The phrase ``tab-stop position _N_ '' shall be taken to mean that,
           from the start of a line of output, tabbing to position _N_ shall
           cause the next character output to be in the (_N_ +1)th column
           position on that line. The maximum number of tab stops allowed is
           terminal-dependent.
    
           It need not be possible to implement _tabs_ on certain terminals. If
           the terminal type obtained from the _TERM_ environment variable or
           **-T** option represents such a terminal, an appropriate diagnostic
           message shall be written to standard error and _tabs_ shall exit
           with a status greater than zero.
    


## OPTIONS



           The _tabs_ utility shall conform to the Base Definitions volume of
           POSIX.1‐2017, _Section 12.2_ , _Utility Syntax Guidelines_ , except for
           various extensions: the options **-a2** , **-c2** , and **-c3** are multi-
           character.
    
           The following options shall be supported:
    
           **-**_n_        Specify repetitive tab stops separated by a uniform
                     number of column positions, _n_ , where _n_ is a single-digit
                     decimal number. The default usage of _tabs_ with no
                     arguments shall be equivalent to _tabs_ -8. When **-0** is
                     used, the tab stops shall be cleared and no new ones
                     set.
    
           **-a** 1,10,16,36,72
                     Assembler, applicable to some mainframes.
    
           **-a2** 1,10,16,40,72
                     Assembler, applicable to some mainframes.
    
           **-c** 1,8,12,16,20,55
                     COBOL, normal format.
    
           **-c2** 1,6,10,14,49
                     COBOL, compact format (columns 1 to 6 omitted).
    
           **-c3** 1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67
                     COBOL compact format (columns 1 to 6 omitted), with more
                     tabs than **-c2**.
    
           **-f** 1,7,11,15,19,23
                     FORTRAN
    
           **-p** 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61
                     PL/1
    
           **-s** 1,10,55
                     SNOBOL
    
           **-u** 1,12,20,44
                     Assembler, applicable to some mainframes.
    
           **-T** _type_   Indicate the type of terminal. If this option is not
                     supplied and the _TERM_ variable is unset or null, an
                     unspecified default terminal type shall be used. The
                     setting of _type_ shall take precedence over the value in
                     _TERM_.
    


## OPERANDS



           The following operand shall be supported:
    
           _n_**[[**_sep_**[** +**]**_n_**]**...**]**
                     A single command line argument that consists of one or
                     more tab-stop values (_n_) separated by a separator
                     character (_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 **"1** 10**+10** +10" are
                     considered to be identical.
    


## STDIN



           Not used.
    


## INPUT FILES



           None.
    


## ENVIRONMENT VARIABLES



           The following environment variables shall affect the execution of
           _tabs_ :
    
           _LANG_      Provide a default value for the internationalization
                     variables that are unset or null. (See the Base
                     Definitions volume of POSIX.1‐2017, _Section 8.2_ ,
                     _Internationalization Variables_ for the precedence of
                     internationalization variables used to determine the
                     values of locale categories.)
    
           _LC_ALL_    If set to a non-empty string value, override the values
                     of all the other internationalization variables.
    
           _LC_CTYPE_  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).
    
           _LC_MESSAGES_
                     Determine the locale that should be used to affect the
                     format and contents of diagnostic messages written to
                     standard error.
    
           _NLSPATH_   Determine the location of message catalogs for the
                     processing of _LC_MESSAGES_.
    
           _TERM_      Determine the terminal type. If this variable is unset
                     or null, and if the **-T** option is not specified, an
                     unspecified default terminal type shall be used.
    


## ASYNCHRONOUS EVENTS



           Default.
    


## 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.
    


## STDERR



           The standard error shall be used only for diagnostic messages.
    


## OUTPUT FILES



           None.
    


## EXTENDED DESCRIPTION



           None.
    


## EXIT STATUS



           The following exit values shall be returned:
    
            0    Successful completion.
    
           >0    An error occurred.
    


## CONSEQUENCES OF ERRORS



           Default.
    
           _The following sections are informative._
    


## APPLICATION USAGE



           This utility makes use of the terminal's hardware tabs and the
           _stty tabs_ option.
    
           This utility is not recommended for application use.
    
           Some integrated display units might not have escape sequences to
           set tab stops, but may be set by internal system calls. On these
           terminals, _tabs_ works if standard output is directed to the
           terminal; if output is directed to another file, however, _tabs_
           fails.
    


## EXAMPLES



           None.
    


## RATIONALE



           Consideration was given to having the _tput_ utility handle all of
           the functions described in _tabs_.  However, the separate _tabs_
           utility was retained because it seems more intuitive to use a
           command named _tabs_ than _tput_ with a new option. The _tput_ utility
           does not support setting or clearing tabs, and no known historical
           version of _tabs_ supports the capability of setting arbitrary tab
           stops.
    
           The System V _tabs_ interface is very complex; the version in this
           volume of POSIX.1‐2017 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.
    
           There was considerable sentiment for specifying only a means of
           resetting the tabs back to a known state—presumably the
           ``standard'' of tabs every eight positions. The following features
           were omitted:
    
            *  Setting tab stops via the first line in a file, using --_file_.
               Since even the SVID has no complete explanation of this
               feature, it is doubtful that it is in widespread use.
    
           In an early proposal, a **-t** _tablist_ option was added for
           consistency with _expand_ ; this was later removed when
           inconsistencies with the historical list of tabs were identified.
    
           Consideration was given to adding a **-p** 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 _terminfo_
           or _termcap_ facilities and might not be supported on a wide range
           of terminals.
    


## FUTURE DIRECTIONS



           None.
    


* * *