Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
expand(1) OSS Shell and Utilities Reference Manual
NAME
expand - Replace tab or space characters
SYNOPSIS
Current syntax
expand [-t tablist][file ...]
Obsolescent syntax
expand [-tabstop | -tab1,tab2,...,tabn][file ...]
The expand command changes tab characters to spaces in the named files or in the standard input
file, and writes the result to the standard output file.
FLAGS
-t tablist Specifies 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 specified, tabs are set tablist column positions apart
instead of the default width (8). If multiple numbers are specified, tabs are set at those
specific 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 specified 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 specified 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 files (before sorting, looking at specific columns, and so on) that
contain tab characters.
EXAMPLES
1. To replace tab characters in file with spaces, enter:
expand file
RELATED INFORMATION
Commands: unexpand(1).
3−120 Hewlett-Packard Company 527188-003