BSD 4_2 development
[unix-history] / usr / man / man1 / expand.1
CommitLineData
d8649de5
C
1.TH EXPAND 1 "18 January 1983"
2.UC 4
3.SH NAME
4expand, unexpand \- expand tabs to spaces, and vice versa
5.SH SYNOPSIS
6.B expand
7[
8\-tabstop
9] [
10\-tab1,tab2,...,tabn
11] [
12file ...
13]
14.br
15.B unexpand
16[
17.B \-a
18] [
19file ...
20]
21.SH DESCRIPTION
22.I Expand
23processes the named files or the standard input writing
24the standard output with tabs changed into blanks.
25Backspace characters are preserved into the output and decrement
26the column count for tab calculations.
27.I Expand
28is useful for pre-processing character files
29(before sorting, looking at specific columns, etc.) that
30contain tabs.
31.PP
32If a single
33.I tabstop
34argument is given then tabs are set
35.I tabstop
36spaces apart instead of the default 8.
37If multiple tabstops are given then the tabs are set at those
38specific columns.
39.PP
40.I Unexpand
41puts tabs back into the data from the standard input or the named
42files and writes the result on the standard output.
43By default only leading blanks and tabs
44are reconverted to maximal strings of tabs. If the
45.B \-a
46option is given, then tabs are inserted whenever they would compress the
47resultant file by replacing two or more characters.