xref: /original-bsd/usr.bin/expand/expand.1 (revision f3c03cba)
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.5 (Berkeley) 07/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.Oo
18.Op Fl Ar tabstop
19.Op Fl Ar tab1,tab2,...,tabn
20.Oo
21.Ar
22.Nm unexpand
23.Op Fl a
24.Ar
25.Sh DESCRIPTION
26.Nm Expand
27processes the named files or the standard input writing
28the standard output with tabs changed into blanks.
29Backspace characters are preserved into the output and decrement
30the column count for tab calculations.
31.Nm Expand
32is useful for pre-processing character files
33(before sorting, looking at specific columns, etc.) that
34contain tabs.
35.Pp
36If a single
37.Ar tabstop
38argument is given, then tabs are set
39.Ar tabstop
40spaces apart instead of the default 8.
41If multiple tabstops are given then the tabs are set at those
42specific columns.
43.Pp
44.Nm Unexpand
45puts tabs back into the data from the standard input or the named
46files and writes the result on the standard output.
47.Pp
48Option (with
49.Nm unexpand
50only):
51.Tw Ds
52.Tp Fl a
53By default, only leading blanks and tabs
54are reconverted to maximal strings of tabs.  If the
55.Fl a
56option is given, then tabs are inserted whenever they would compress the
57resultant file by replacing two or more characters.
58.Tp
59.Sh HISTORY
60.Nm Expand
61appeared in 3 BSD.
62