version 1.9, 2003/10/27 12:24:11 |
version 1.10, 2006/10/16 15:45:09 |
|
|
.Nd expand tabs to spaces, and vice versa |
.Nd expand tabs to spaces, and vice versa |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm expand |
.Nm expand |
.Op Fl Ns Ar tabstop |
.Op Fl t Ar tablist |
.Oo Xo |
.Op Ar |
.Sm off |
|
.Fl Ar tab1 , tab2 , |
|
.Ar ... , Ar tabn |
|
.Sm on |
|
.Oc |
|
.Xc |
|
.Op Ar file Ar ... |
|
.Nm expand |
|
.Op Fl t Ar tabstop |
|
.Oo Xo |
|
.Sm off |
|
.Fl t\ \& Ar tab1 , tab2 , |
|
.Ar ... , Ar tabn |
|
.Sm on |
|
.Oc |
|
.Xc |
|
.Op Ar file Ar ... |
|
.Nm unexpand |
.Nm unexpand |
.Op Fl a |
.Op Fl a |
.Op Ar file Ar ... |
.Op Ar |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm expand |
.Nm expand |
processes the named files or the standard input, |
processes the named files or the standard input, |
|
|
(before sorting, looking at specific columns, etc.) that |
(before sorting, looking at specific columns, etc.) that |
contain tabs. |
contain tabs. |
.Pp |
.Pp |
If a single |
If the argument to |
.Ar tabstop |
.Fl t , |
argument is given, tabs are set |
.Ar tablist , |
.Ar tabstop |
consists of a single numerical argument, tabs are set |
|
.Ar tablist |
spaces apart instead of the default 8. |
spaces apart instead of the default 8. |
If multiple tabstops are given, then the tabs are set at those |
If multiple |
|
.Fl t |
|
options are given, then the tabs are set at those |
specific columns. |
specific columns. |
In the synopsis above, both forms of the |
|
.Nm |
|
command are identical. |
|
.Pp |
.Pp |
If a list of tabstops is given, it should consist of a list |
Otherwise the argument to |
of two or more positive decimal integers, in ascending order. |
.Fl t |
In the event of having to process a |
may consist of a list |
|
of two or more positive decimal integers, |
|
comma separated, |
|
in ascending order: |
|
in the event of having to process a |
.Aq tab |
.Aq tab |
at a position beyond the last of those specified in a multiple tabstop list, |
at a position beyond the last of those specified in a multiple |
|
.Fl t |
|
list, |
the |
the |
.Aq tab |
.Aq tab |
is replaced by a single |
is replaced by a single |
.Aq space |
.Aq space |
character. |
character. |
.Pp |
.Pp |
|
This implementation of |
|
.Nm |
|
additionally allows |
|
.Ar tablist |
|
to be specified without using the |
|
.Fl t |
|
flag, by prefixing |
|
.Ar tablist |
|
with a dash |
|
.Pq - . |
|
.Pp |
.Nm unexpand |
.Nm unexpand |
puts tabs back into the data from the standard input or the named |
puts tabs back into the data from the standard input or the named |
files and writes the result on the standard output. |
files and writes the result on the standard output. |
|
|
and |
and |
.Nm unexpand |
.Nm unexpand |
utilities are compliant with the |
utilities are compliant with the |
.St -p1003.1 |
.St -p1003.1-2004 |
specification, with the following exceptions: |
specification, with the following exceptions: |
.Bl -bullet -offset indent |
.Bl -bullet -offset indent |
.It |
.It |
.Tn POSIX |
.Tn POSIX |
does not support specifying tabstops without use of the |
does not support specifying tabstops without use of the |
.Fl t |
.Fl t |
flag (first form in |
flag. |
.Sx SYNOPSIS |
|
above). |
|
.It |
.It |
.Tn POSIX |
.Tn POSIX |
specifies that multiple tabstops may be given separated by |
specifies that multiple tabstops may be given separated by |