The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


tabs - set terminal tabs


tabs [ -n| -a| -a2| -c| -c2| -c3| -f| -p| -s| -u][+m[n]]
[-T type]

tabs [-T type][ +[n]] n1[,n2,...]


The tabs utility displays a series of characters that first clears the hardware terminal tab settings and then initialises the tab stops at the specified positions and optionally adjusts the margin.

The phrase "tab-stop position N" is taken to mean that, from the start of a line of output, tabbing to position N will 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 will be written to standard error and tabs will exit with a status greater than zero.


The tabs utility supports the XBD specification, Utility Syntax Guidelines  , except for various extensions: the options -a2, -c2 and -c3 are multi-character and +mn uses a leading plus sign and an optional option-argument.

The following options are supported:

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 is equivalent to tabs -8. When -0 is used, the tab stops are cleared and no new ones set.
1,10,16,36,72 Assembler, applicable to some mainframes.
1,10,16,40,72 Assembler, applicable to some mainframes.
1,8,12,16,20,55 COBOL, normal format.
1,6,10,14,49 COBOL, compact format (columns 1-6 omitted).
1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67 COBOL compact format (columns 1-6 omitted), with more tabs than -c2.
1,7,11,15,19,23 FORTRAN
1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61 PL/1
1,10,55 SNOBOL
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 will be used. The setting of type will take precedence over the value in TERM .
Reset the margin. The margin argument can be used for some terminals. It causes all tabs to be moved over n columns by making column n+1 the left margin. If n is omitted, the default is 10. The normal (leftmost) margin on most terminals is obtained by +m0. The margin for most terminals is reset only when the +m flag is given explicitly.


The following operand is supported:
A single command-line argument that consists of tab-stop values separated using either commas or blank characters. The tab-stop values will be positive decimal integers in strictly ascending order. 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. For example, the tab lists 1,10,20,30 and 1,10,+10,+10 are considered to be identical.


Not used.




The following environment variables affect the execution of tabs:
Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
If set to a non-empty string value, override the values of all the other internationalisation variables.
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
Determine the location of message catalogues for the processing of LC_MESSAGES .
Determine the terminal type. If this variable is unset or null, and if the -T option is not specified, an unspecified default terminal type will be used.




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.


Used only for diagnostic messages.






The following exit values are returned:
Successful completion.
An error occurred.




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 will work if standard output is directed to the terminal; if output is directed to another file, however, tabs will fail.






expand, stty, unexpand.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]