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