coreutils: unexpand invocation
1
1 9.3 ‘unexpand’: Convert spaces to tabs
1 ======================================
1
1 ‘unexpand’ writes the contents of each given FILE, or standard input if
1 none are given or for a FILE of ‘-’, to standard output, converting
1 blanks at the beginning of each line into as many tab characters as
1 needed. In the default POSIX locale, a “blank” is a space or a tab;
1 other locales may specify additional blank characters. Synopsis:
1
1 unexpand [OPTION]... [FILE]...
1
1 By default, ‘unexpand’ converts only initial blanks (those that
1 precede all non-blank characters) on each line. It preserves backspace
1 characters in the output; they decrement the column count for tab
1 calculations. By default, tabs are set at every 8th column.
1
11 The program accepts the following options. Also see ⇒Common
options.
1
1 ‘-t TAB1[,TAB2]...’
1 ‘--tabs=TAB1[,TAB2]...’
1 If only one tab stop is given, set the tabs TAB1 columns apart
1 instead of the default 8. Otherwise, set the tabs at columns TAB1,
1 TAB2, ... (numbered from 0), and leave blanks beyond the tab stops
1 given unchanged. Tab stops can be separated by blanks as well as
1 by commas.
1
1 As a GNU extension the last TAB specified can be prefixed with a
1 ‘/’ to indicate a tab size to use for remaining positions. For
1 example, ‘--tabs=2,4,/8’ will set tab stops at position 2 and 4,
1 and every multiple of 8 after that.
1
1 Also the last TAB specified can be prefixed with a ‘+’ to indicate
1 a tab size to use for remaining positions, offset from the final
1 explicitly specified tab stop. For example, to ignore the 1
1 character gutter present in diff output, one can specify a 1
1 character offset using ‘--tabs=1,+8’, which will set tab stops at
1 positions 1,9,17,...
1
1 This option implies the ‘-a’ option.
1
1 For compatibility, GNU ‘unexpand’ supports the obsolete option
1 syntax, ‘-TAB1[,TAB2]...’, where tab stops must be separated by
1 commas. (Unlike ‘-t’, this obsolete option does not imply ‘-a’.)
1 New scripts should use ‘--first-only -t TAB1[,TAB2]...’ instead.
1
1 ‘-a’
1 ‘--all’
1 Also convert all sequences of two or more blanks just before a tab
1 stop, even if they occur after non-blank characters in a line.
1
1 An exit status of zero indicates success, and a nonzero value
1 indicates failure.
1