Sets tab stops on terminals.
The tabs command specifies tab stops on terminals that support remotely settable hardware tab characters. Tab stops are set according to the TabSpec parameter, and previous settings are erased.
When you use the tabs command, always refer to the leftmost column number as 1, even if your workstation refers to it as 0.
If you do not specify the TabSpec parameter, the default value is -8.
The following preset formats can be specified for the TabSpec parameter:
Item | Description |
---|---|
-a | Sets the tabs to 1, 10, 16, 36, and 72 (IBM® System/370 Assembler first format). |
-a2 | Sets the tabs to 1, 10, 16, 40, and 72 (IBM System/370 Assembler second format). |
-c | Sets the tabs to 1, 8, 12, 16, 20, and 55 (COBOL normal format). |
-c2 | Sets the tabs to 1, 6, 10, 14, and 49 (COBOL compact format,
columns 1-6 omitted). With this code, the first column position corresponds
to card column 7. One space gets you to column 8, and a tab gets you
to column 12. Files using this code should include a format specification
of:
|
-c3 | Sets the tabs to 1, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42,
46, 50, 54, 58, 62, and 67 (COBOL compact format with more tabs than -c2). These tabs provide the
recommended format for COBOL. Files using this code should include
a format specification of:
|
-f | Sets the tabs to 1, 7, 11, 15, 19, and 23 (FORTRAN). |
-p | Sets the tabs to 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, and 61 (PL/I). |
-s | Sets the tabs to 1, 10, and 55 (SNOBOL). |
-u | Sets the tabs to 1, 12, 20, and 44. |
In addition to the preset formats, the TabSpecs parameter can include:
Item | Description |
---|---|
-Number | Sets regularly repeating tabs at every Number column. (The standard operating system tab setting is -8. The -8 setting is required when using the nroff command with the -h flag.) Another special case is the -0 setting, which implies no tabs at all. If more than 20 tabs are set, you must run the tabs command twice to clear them. |
Number1, Number2,... | Sets tabs at the specified column numbers (a comma-separated list in ascending order). You can specify up to 40 numbers. If any number except the first has a plus-sign prefix, the prefixed number is added to the previous number for the next setting. Thus, the tab list specified by 1,10,20,30 provides the same tab settings as the tab list specified by 1,10,+10,+10. |
-Filep | Reads the first line of the Filep file for a format specification. If the tabs command finds a format specification, the tabs command sets tabs as specified. If the tabs command does not find a format specification, it sets tabs to the system default (-8). |
It is sometimes convenient to maintain text files with nonstandard tab stop settings (tab stops that are not set at every eighth column). Such files must be converted to a standard format. This is often done by replacing all tab characters with the appropriate number of space characters, before they can be processed by any commands. A format specification occurring in the first line of a text file specifies how tab characters are to be expanded in the remainder of the file.
A format specification consists of a sequence of parameters separated by blanks and surrounded by <: and :>. Each parameter consists of a letter key, possibly followed immediately by a value. The following parameters are recognized:
Item | Description |
---|---|
ttabs | Specifies the tab stop settings for a file. The value of tabs must
be one of the following:
|
ssize | Specifies a maximum line size. The value of size must be an integer. Size checking is performed after tab characters have been expanded, but before the margin is adjusted. |
mmargin | Specifies the number of space characters to be added to the beginning of each line. The value of margin must be an integer. |
d | Indicates that the line containing the format specification is to be deleted from the converted file. The d parameter takes no value. |
e | Indicates that the current format is valid only until another format specification is encountered in the file. The e parameter takes no value. |
Default values, which are assumed for parameters not supplied, are t-8 and m0. If the s parameter is not specified, no size checking is performed. If the first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The following is an example of a line containing a format specification:
<:t5,10,15 s72:>
If a format specification can be disguised as a comment, it is not necessary to code the d parameter.
Item | Description |
---|---|
-TTerminal | Identifies the terminal so the tabs command can set
tabs and margins correctly. The Terminal variable is one of
the terminals specified in the greek command.
Supported values for the Terminal variable include:
Additional hardcopy terminals supported by the tabs command include:
If you do not provide the -T flag, the value of the environment variable TERM is used. If the -T flag is provided with no value or if -T and TERM have invalid values, the error message unknown terminal is displayed and the command terminates. |
+m Number | Moves all tabs to the right the number of columns specified
by the Number variable. This flag also sets the left margin
to the column specified by the Number variable. If m is
specified without a value, the default value for the Number variable
is 10. The leftmost margin on most workstations is defined by +m0.
The first column for tabs is defined as column 0 not column 1. Note: If the same flag occurs more than once, only the last flag takes effect. |
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
tabs -4
tabs -10 -TANSI
Item | Description |
---|---|
/usr/bin/tabs | Contains the tabs command. |