Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tabs - set terminal tabs

&pagelevel(4)&pagelevel

This command is only available to users accessing the POSIX shell via rlogin.


tabs sets the tab stops on the user’s terminal, clearing any previous settings. For tabs to be effective, the terminal must have hardware tabs that can be set remotely using escape sequences.
The lowest column number is 1. For tabs, column 1 refers to the leftmost column on the screen, even on terminals whose column markers begin at 0.


Syntax


tabs[ -T type][ +mn][ tabspec]

-T type

Terminal type, which needs to be known for margin setting. type is a name listed in /usr/share/lib/terminfo.

-T type not specified:
tabs uses the value of the TERM environment variable. If TERM is not defined in the current environment, tabs uses a type whose attributes are valid for many terminals.

+mn

All tabs are moved n columns to the right, with n+1 becoming the left margin. If n is omitted, a value of 10 is assumed. For a TermiNet, the first value in the tab list should be 1, or the margin will move even further to the right. Normally, the leftmost margin is set with +m0. On most terminals, the margin is reset further to the right only when +m is specified explicitly.

tabspec

Four different types of tab specification are permitted:

-code

tabs in a predefined pattern (canned)

-n

tabs at regular intervals (repetitive)

--file

tabs in a pattern defined in file (file)

n1[,n2...]

tabs at freely selectable positions (arbitrary)


-code

You determine the pattern of tabs on a line by specifying one of the following:

-a

Tab stops in columns 1,10,16,36,72.
This corresponds to Assembler, IBM S/370, first format.

-a2

Tab stops in columns 1,10,16,40,72.
This corresponds to Assembler, IBM S/370, second format.

-c

Tab stops in columns 1,8,12,16,20,55.
This corresponds to COBOL normal format.

-c2

Tab stops in columns 1,6,10,14,49.
This corresponds to COBOL compact format. Columns 1-6 are omitted. The first character typed corresponds to card column 7, one space takes you to column 8, and a tab reaches column 12. Files using this tab setup should include a format specification as follows:
<:t  -c2  m6  s66  d:>

-c3

Tab stops in columns 1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67.
This corresponds to COBOL compact format with additional tabs. Columns
1-6 are omitted. The first character typed corresponds to card column 7,
one space takes you to column 8, and a tab reaches column 12. Files using
this tab setup should include a format specification as follows:
<:t  -c3  m6  s66  d:>.
This is the recommended format for COBOL.

-f

Tab stops in columns 1,7,11,15,19,23.
This corresponds to FORTRAN format.

-p

Tab stops in columns 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61.
This corresponds to PL/I format.

-s

Tab stops in columns 1,10,55.
This corresponds to SNOBOL format.

-u

Tab stops in columns 1,12,20,44.
This corresponds to UNIVAC 1100 Assembler format.


-n

The number specified causes tab stops to be set in columns 1+n,1+2n,1+3n. Specifying 8 eight gives you the Unix system standard tab setting. Specifying 0 clears all tab stops.


--file

tabs reads the first line of the file, searching for a format specification. If it finds one, it sets the tab stops accordingly. Otherwise, the default value 8 is assumed. This type of format may be used to ensure that a tabbed file is printed with the correct tab settings, with tabs being used in conjunction with pr (see pr).


n1[,n2,...]

You can freely select the columns for the tab stops by means of a list containing up to 64 numbers in ascending order. A number preceded by a plus sign is added to the value of the previous number. This does not apply to the first number. The format 1,10,20,30, for example, can be specified as 1,10,+10,+10.

The numbers are separated by a comma, or the list is enclosed in quotes, whereby the numbers are separated by a comma and/or a blank. n1[,n2,...] must be specified as the last argument in the command line.


tabspec not specified:
tabs uses the default setting -8, which corresponds to the Unix system standard tab setting. 

Hint

The mechanisms for clearing tab stops and setting the left margin are not the same on every terminal. tabs can set a maximum of 64 tab stops, but will only clear 20.

Error

illegal tabs

When setting arbitrary tab stops you failed to maintain ascending order or you specified a zero.


illegal increment

When setting arbitrary tab stops you specified a zero or omitted an increment.


unknown tab code

The code you specified as tabspec cannot be found.


can't open

The file you specified as tabspec cannot be opened.


file indirection

The format specification in the file specified as tabspec points to another file. Indirect references of this sort are not permitted.


tabs cannot be set for this terminal

You are running the command on an unknown terminal type, e.g. on a block-mode terminal.

File

/usr/share/lib/terminfo/?/*

Files used to name and define terminals

Variable

TERM

Terminal type

Locale

The following environment variables affect the execution of tabs:

LANG

Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

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- as opposed to multi-byte characters in arguments and input files), the classification of characters as upper- to lower-case, and the mapping of characters from one case to the other.

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.

Example 1

Setting tab stops in COBOL normal format.

$ tabs -c

Example 2

Set a tab in every sixth column, i.e. in columns 1,7,13,19,...

$ tabs -6

Example 3

Set tabs in columns 1, 8 and 36.

$ tabs 1,8,36

This has the same effect as

$ tabs 1,+7,+28

Example 4

Setting tab stops in accordance with the first line (format specification) of your file $HOME/tabspec.list/file1.

$ tabs --$HOME/tabspec.list/file1

See also

pr, tput
environ, fspec, term, terminfo