unexpand

NAME

unexpand - compress spaces into tabs

SYNOPSIS

unexpand [-a|-t tablist] [file ...]

DESCRIPTION

The unexpand(1) utility converts spaces into tabs in the data from the standard input or the named files, and then writes the result on the standard output. Backspace characters are preserved into the output and decrement the column count for tab calculations. Without options, unexpand(1) only converts leading blank characters, those at the beginnings of lines.

The unexpand(1) utility takes these options:

-a
By default, only leading blanks and tabs are reconverted to maximal strings of tabs. If the -a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters.
-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 8 (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 spaces.

If multiple tabstops are given (separated by blank characters or commas), the tabs are set at those specific columns. Blank characters beyond the last specified tabstop are not converted.

If -t is specified, -a is ignored.

DIAGNOSTICS

The unexpand(1) utility exits with status 0 on success and >0 if an error, such as a problem opening a file, occurred.

SEE ALSO

expand(1)