xref: /original-bsd/usr.bin/expand/expand.1 (revision f955cb91)
1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)expand.1	6.7 (Berkeley) 07/26/91
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 Fl Ns Ar tabstop
18.Op Fl Ns Ar 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.Bl -tag -width flag
50.It Fl a
51By default, only leading blanks and tabs
52are reconverted to maximal strings of tabs.  If the
53.Fl a
54option is given, then tabs are inserted whenever they would compress the
55resultant file by replacing two or more characters.
56.El
57.Sh HISTORY
58The
59.Nm expand
60command appeared in
61.Bx 3.0 .
62