xref: /minix3/usr.bin/expand/expand.1 (revision 563dd2c8f457d86bc480c9174410214b1318927c)
1*563dd2c8SLionel Sambuc.\"	$NetBSD: expand.1,v 1.12 2012/05/12 14:52:57 reed Exp $
2*563dd2c8SLionel Sambuc.\"
3*563dd2c8SLionel Sambuc.\" Copyright (c) 1980, 1990, 1993
4*563dd2c8SLionel Sambuc.\"	The Regents of the University of California.  All rights reserved.
5*563dd2c8SLionel Sambuc.\"
6*563dd2c8SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
7*563dd2c8SLionel Sambuc.\" modification, are permitted provided that the following conditions
8*563dd2c8SLionel Sambuc.\" are met:
9*563dd2c8SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
10*563dd2c8SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
11*563dd2c8SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
12*563dd2c8SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
13*563dd2c8SLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
14*563dd2c8SLionel Sambuc.\" 3. Neither the name of the University nor the names of its contributors
15*563dd2c8SLionel Sambuc.\"    may be used to endorse or promote products derived from this software
16*563dd2c8SLionel Sambuc.\"    without specific prior written permission.
17*563dd2c8SLionel Sambuc.\"
18*563dd2c8SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19*563dd2c8SLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*563dd2c8SLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*563dd2c8SLionel Sambuc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22*563dd2c8SLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*563dd2c8SLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*563dd2c8SLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*563dd2c8SLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*563dd2c8SLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*563dd2c8SLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*563dd2c8SLionel Sambuc.\" SUCH DAMAGE.
29*563dd2c8SLionel Sambuc.\"
30*563dd2c8SLionel Sambuc.\"	@(#)expand.1	8.1 (Berkeley) 6/9/93
31*563dd2c8SLionel Sambuc.\"
32*563dd2c8SLionel Sambuc.Dd December 20, 2008
33*563dd2c8SLionel Sambuc.Dt EXPAND 1
34*563dd2c8SLionel Sambuc.Os
35*563dd2c8SLionel Sambuc.Sh NAME
36*563dd2c8SLionel Sambuc.Nm expand ,
37*563dd2c8SLionel Sambuc.Nm unexpand
38*563dd2c8SLionel Sambuc.Nd expand tabs to spaces, and vice versa
39*563dd2c8SLionel Sambuc.Sh SYNOPSIS
40*563dd2c8SLionel Sambuc.Nm
41*563dd2c8SLionel Sambuc.Op Fl t Ar tabstop
42*563dd2c8SLionel Sambuc.Op Fl t Ar tab1,tab2,...,tabn
43*563dd2c8SLionel Sambuc.Op Ar
44*563dd2c8SLionel Sambuc.Nm unexpand
45*563dd2c8SLionel Sambuc.Op Fl a
46*563dd2c8SLionel Sambuc.Op Fl t Ar tab1,tab2,...,tabn
47*563dd2c8SLionel Sambuc.Op Ar
48*563dd2c8SLionel Sambuc.Sh DESCRIPTION
49*563dd2c8SLionel Sambuc.Nm
50*563dd2c8SLionel Sambucprocesses the named files or the standard input writing
51*563dd2c8SLionel Sambucthe standard output with tabs changed into blanks.
52*563dd2c8SLionel SambucBackspace characters are preserved into the output and decrement
53*563dd2c8SLionel Sambucthe column count for tab calculations.
54*563dd2c8SLionel Sambuc.Nm
55*563dd2c8SLionel Sambucis useful for pre-processing character files
56*563dd2c8SLionel Sambuc(before sorting, looking at specific columns, etc.) that
57*563dd2c8SLionel Sambuccontain tabs.
58*563dd2c8SLionel Sambuc.Pp
59*563dd2c8SLionel SambucIf a single
60*563dd2c8SLionel Sambuc.Ar tabstop
61*563dd2c8SLionel Sambucargument is given, then tabs are set
62*563dd2c8SLionel Sambuc.Ar tabstop
63*563dd2c8SLionel Sambucspaces apart instead of the default 8.
64*563dd2c8SLionel SambucIf multiple tabstops are given then the tabs are set at those
65*563dd2c8SLionel Sambucspecific columns.
66*563dd2c8SLionel Sambuc.Pp
67*563dd2c8SLionel Sambuc.Nm unexpand
68*563dd2c8SLionel Sambucputs tabs back into the data from the standard input or the named
69*563dd2c8SLionel Sambucfiles and writes the result on the standard output.
70*563dd2c8SLionel Sambuc.Pp
71*563dd2c8SLionel SambucOption (with
72*563dd2c8SLionel Sambuc.Nm unexpand
73*563dd2c8SLionel Sambuconly):
74*563dd2c8SLionel Sambuc.Bl -tag -width flag
75*563dd2c8SLionel Sambuc.It Fl a
76*563dd2c8SLionel SambucBy default, only leading blanks and tabs
77*563dd2c8SLionel Sambucare reconverted to maximal strings of tabs.
78*563dd2c8SLionel SambucIf the
79*563dd2c8SLionel Sambuc.Fl a
80*563dd2c8SLionel Sambucoption is given, then tabs are inserted whenever they would compress the
81*563dd2c8SLionel Sambucresultant file by replacing two or more characters.
82*563dd2c8SLionel Sambuc.El
83*563dd2c8SLionel Sambuc.Sh HISTORY
84*563dd2c8SLionel SambucThe
85*563dd2c8SLionel Sambuc.Nm
86*563dd2c8SLionel Sambuccommand appeared in
87*563dd2c8SLionel Sambuc.Bx 1 .
88