expand

NAME

expand - expand tabs to spaces

SYNOPSIS

expand [-t tablist] [file ...]
expand [-tabstop] [-tab1,tab2,...,tabn] [file ...]

DESCRIPTION

The expand(1) utility processes the named files or the standard input, writing the standard output with tabs changed into blanks. Backspace characters are preserved into the output and decrement the column count for tab calculations. The expand(1) utility is useful for pre-processing character files (before sorting, looking at specific columns, and so on) that contain tabs.

OPTIONS

-t tablist
Specify tab stops according to tablist. The tablist is one or more positive decimal integers. If there is only one number, tabs are set tablist columns apart instead of eight (the default).

If more than one number is specified, they are taken as the positions of the tabstops. The numbers must be in ascending order.

-tabstop
If a single tabstop argument is given, tabs are set tabstop spaces apart instead of the default eight. If multiple tabstops are given (separated by blank characters or commas), the tabs are set at those specific columns.

Any tab characters beyond the last specified tab in a multiple tabstop list are replaced by a single space.

DIAGNOSTICS

The expand(1) utility exits with status 0 on success and >0 if an error occurred; if, for example, a problem arose while attempting to open a file.

SEE ALSO

unexpand(1)