xref: /original-bsd/usr.bin/expand/expand.1 (revision 9d81f6f7)
1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)expand.1	6.4 (Berkeley) 06/24/90
7.\"
8.Dd
9.Dt EXPAND 1
10.Os BSD 4
11.Sh NAME
12.Nm expand ,
13.Nm unexpand
14.Nd expand tabs to spaces, and vice versa
15.Sh SYNOPSIS
16.Nm expand
17.Op \-tabstop
18.Op \-tab1,tab2,...,tabn
19.Ar
20.Nm unexpand
21.Op Fl a
22.Ar
23.Sh DESCRIPTION
24.Nm Expand
25processes the named files or the standard input writing
26the standard output with tabs changed into blanks.
27Backspace characters are preserved into the output and decrement
28the column count for tab calculations.
29.Nm Expand
30is useful for pre-processing character files
31(before sorting, looking at specific columns, etc.) that
32contain tabs.
33.Pp
34If a single
35.Ar tabstop
36argument is given, then tabs are set
37.Ar tabstop
38spaces apart instead of the default 8.
39If multiple tabstops are given then the tabs are set at those
40specific columns.
41.Pp
42.Nm Unexpand
43puts tabs back into the data from the standard input or the named
44files and writes the result on the standard output.
45.Pp
46Option (with
47.Nm unexpand
48only):
49.Tp Fl a
50By default, only leading blanks and tabs
51are reconverted to maximal strings of tabs.  If the
52.Fl a
53option is given, then tabs are inserted whenever they would compress the
54resultant file by replacing two or more characters.
55.Tp
56.Sh HISTORY
57.Nm Expand
58appeared in 3 BSD.
59