Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

expand(1) OSS Shell and Utilities Reference Manual
NAME
expand - Replace tab or space characters
SYNOPSIS
Current syntax
expand [-t tablist][le ...]
Obsolescent syntax
expand [-tabstop | -tab1,tab2,...,tabn][le ...]
The expand command changes tab characters to spaces in the named les or in the standard input
le, and writes the result to the standard output le.
FLAGS
-t tablist Species the tab stops. The tablist argument consists of a single positive decimal
integer or multiple positive decimal integers, separated by spaces or commas, in ascend-
ing order. If a single number is specied, tabs are set tablist column positions apart
instead of the default width (8). If multiple numbers are specied, tabs are set at those
specic column positions. Tabbing to tab stop position n thus causes the next character
output to be in the (n+1)th column position on that line.
If the expand command has to process a tab character at a position beyond the last of
those specied in a multiple tab stop list, the tab character is replaced by a single space
in the output.
-tabstop Sets tab stops tabstop spaces apart instead of the default distance (8). (Obsolescent.)
-tab1, tab2, ..., tabn
Sets tab stops at specied columns. Columns are measured in bytes. (Obsolescent.)
DESCRIPTION
Backspace characters are preserved in the output and decrement the column count for tab calcula-
tions. The column position count cannot be decremented below zero. The expand command is
useful for preprocessing character les (before sorting, looking at specic columns, and so on) that
contain tab characters.
EXAMPLES
1. To replace tab characters in le with spaces, enter:
expand le
RELATED INFORMATION
Commands: unexpand(1).
3120 Hewlett-Packard Company 527188-004