expand(1)
NAME
expand, unexpand − expand tabs to spaces, and vice versa
SYNOPSIS
expand [-t tablist] [file ...]
unexpand [-a] [-t tablist] [file ...]
Obsolescent:
expand [- tabstop] [- tab1,tab2, ..., tabn] [file ...]
DESCRIPTION
expand processes the named files or the standard input and writes to the standard output with tabs changed into spaces. Backspace characters are preserved in the output and decrement the column count for tab calculations. If a tab character is found after the last tab position, it is replaced by a single space. expand is useful for preprocessing character files that contain tabs (before sorting, looking at specific columns, etc).
expand recognizes the following command-line options and arguments:
[-t tablist] tablist specifies where to set the tab positions instead of the default 8. tablist can take two forms. If it is a single number, tabs are set tablist spaces apart. tablist can also be a blank- or comma-separated list of increasing positions where tabs are to be set.
[-tabstop] This option is obsolescent and is equivalent to using -t tabstop.
[-tab1,tab2,...,tabn]
This option is obsolescent and is equivalent to using -t tab1,tab2, ...,tabn.
unexpand processes the named files or the standard input and writes to the standard output with spaces changed into tabs where possible. By default, only leading spaces and tabs are converted to maximal strings of tabs. The default tab position is every 8 characters. Backspace characters are preserved into the output, and decrement the column count for tab calculations.
unexpand recognizes the following command-line options and arguments:
-a Tabs are inserted whenever they would compress the resultant file by replacing two or more spaces before a tab position.
−t tablist tablist specifies the tab positions. tablist can take two forms. If it is a single number, tabs are set every tablist spaces apart. If tablist is a blank- or comma-separated list of increasing positions, tabs are set at those locations. The -t option implies the -a option. If the -t option is not specified, the default is equivalent to specifying -t 8 except that -a is not implied for this case.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992