EXPAND(1) — User’s Manual — Commands
NAME
expand, unexpand − expand tabs to spaces, and vice versa
SYNOPSIS
expand [ −tabstop ] [ −tab1,tab2,...,tabn ] [ file ... ]
unexpand [ −a ] [ file ... ]
DESCRIPTION
Expand copies the named files (or the standard input) to the standard output, with tabs changed into spaces (blanks). Backspace characters are preserved into the output and decrement the column count for tab calculations. Expand is useful for pre-processing character files (before sorting, looking at specific columns, etc.) that contain tabs.
Unexpand copies the named files (or the standard input) to the standard output, putting tabs back into the data. By default only leading spaces (blanks) and tabs are converted to strings of tabs, but this can be overridden by the −a option (see the options section below).
OPTIONS
There are two ways of specifying the tab stop positions:
tabstop
Specified as a single argument sets tabs tabstop spaces apart instead of the default 8.
−tab1,tab2,...,tabn
Set tabs at the columns specified by tab1...
−a Insert tabs when replacing a run of two or more spaces would produce a smaller output file. This option only applies to unexpand.
Sun System Release 0.3 — 26 April 1983