unexpand writes the contents of each given file, or standard input if none are given or for a file of ‘-’, to standard output, converting blanks at the beginning of each line into as many tab characters as needed. In the default POSIX locale, a blank is a space or a tab; other locales may specify additional blank characters. Synopsis:
unexpand [option]... [file]...
By default, unexpand converts only initial blanks (those that precede all non-blank characters) on each line. It preserves backspace characters in the output; they decrement the column count for tab calculations. By default, tabs are set at every 8th column.
The program accepts the following options. Also see Common options.
For compatibility, GNU unexpand supports the obsolete option syntax,
-tab1[,tab2]..., where tab stops must be
separated by commas. (Unlike -t, this obsolete option does
not imply -a.) New scripts should use --first-only -t
tab1[,tab2]... instead.
An exit status of zero indicates success, and a nonzero value indicates failure.