bring up to rev 5
[unix-history] / usr / src / usr.bin / expand / expand.1
CommitLineData
297a0a40
KB
1.\" Copyright (c) 1980 The Regents of the University of California.
2.\" All rights reserved.
5451a149 3.\"
297a0a40
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)expand.1 6.3 (Berkeley) %G%
5451a149 17.\"
24fbc0bd 18.TH EXPAND 1 ""
5451a149
KM
19.UC 4
20.SH NAME
21expand, unexpand \- expand tabs to spaces, and vice versa
22.SH SYNOPSIS
23.B expand
24[
25\-tabstop
26] [
27\-tab1,tab2,...,tabn
28] [
29file ...
30]
31.br
32.B unexpand
33[
34.B \-a
35] [
36file ...
37]
38.SH DESCRIPTION
39.I Expand
40processes the named files or the standard input writing
41the standard output with tabs changed into blanks.
42Backspace characters are preserved into the output and decrement
43the column count for tab calculations.
44.I Expand
45is useful for pre-processing character files
46(before sorting, looking at specific columns, etc.) that
47contain tabs.
48.PP
49If a single
50.I tabstop
bfe02f44 51argument is given, then tabs are set
5451a149
KM
52.I tabstop
53spaces apart instead of the default 8.
54If multiple tabstops are given then the tabs are set at those
55specific columns.
56.PP
57.I Unexpand
58puts tabs back into the data from the standard input or the named
59files and writes the result on the standard output.
bfe02f44 60By default, only leading blanks and tabs
5451a149
KM
61are reconverted to maximal strings of tabs. If the
62.B \-a
63option is given, then tabs are inserted whenever they would compress the
64resultant file by replacing two or more characters.