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