-w is obsolete
[unix-history] / usr / src / usr.bin / expand / expand.1
CommitLineData
5451a149
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
24fbc0bd 5.\" @(#)expand.1 6.1 (Berkeley) %G%
5451a149 6.\"
24fbc0bd 7.TH EXPAND 1 ""
5451a149
KM
8.UC 4
9.SH NAME
10expand, unexpand \- expand tabs to spaces, and vice versa
11.SH SYNOPSIS
12.B expand
13[
14\-tabstop
15] [
16\-tab1,tab2,...,tabn
17] [
18file ...
19]
20.br
21.B unexpand
22[
23.B \-a
24] [
25file ...
26]
27.SH DESCRIPTION
28.I Expand
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.
33.I Expand
34is useful for pre-processing character files
35(before sorting, looking at specific columns, etc.) that
36contain tabs.
37.PP
38If a single
39.I tabstop
40argument is given then tabs are set
41.I tabstop
42spaces apart instead of the default 8.
43If multiple tabstops are given then the tabs are set at those
44specific columns.
45.PP
46.I Unexpand
47puts tabs back into the data from the standard input or the named
48files and writes the result on the standard output.
49By default only leading blanks and tabs
50are reconverted to maximal strings of tabs. If the
51.B \-a
52option is given, then tabs are inserted whenever they would compress the
53resultant file by replacing two or more characters.