Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man1 / fmt.1
blob1cd01eebf4a73f539af47c6b5b4eef4a461774e7
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH FMT 1 "May 9, 1997"
7 .SH NAME
8 fmt \- simple text formatters
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBfmt\fR [\fB-cs\fR] [\fB-w\fR \fIwidth\fR | \fB-width\fR] [\fIinputfile\fR]...
13 .fi
15 .SH DESCRIPTION
16 .sp
17 .LP
18 \fBfmt\fR is a simple text formatter that fills and joins lines  to produce
19 output lines of (up to) the number of characters specified in the \fB-w\fR\fI
20 width\fR option. The default  \fIwidth\fR is \fB72\fR. \fBfmt\fR concatenates
21 the \fIinputfile\fRs listed as arguments. If none are given, \fBfmt\fR formats
22 text from the standard input.
23 .sp
24 .LP
25 Blank lines are preserved in the output, as is the spacing between words.
26 \fBfmt\fR does not fill nor split lines beginning with a `\fB\&.\fR' (dot), for
27 compatibility with \fBnroff\fR(1). Nor does it fill or split a set of
28 contiguous non-blank lines which is determined to be a mail header, the first
29 line of which must begin with "\fBFrom\fR".
30 .sp
31 .LP
32 Indentation is preserved in the output, and input lines with differing
33 indentation are not joined (unless \fB-c\fR is used).
34 .sp
35 .LP
36 \fBfmt\fR can also be used as an in-line text filter for \fBvi\fR(1). The
37 \fBvi\fR command:
38 .sp
39 .LP
40 \fB!}fmt\fR
41 .sp
42 .LP
43 reformats the text between the cursor location and the end of the paragraph.
44 .SH OPTIONS
45 .sp
46 .ne 2
47 .na
48 \fB\fB-c\fR\fR
49 .ad
50 .RS 21n
51 Crown margin mode. Preserve the indentation of the first two lines within a
52 paragraph, and align the left margin of each subsequent line with that of the
53 second line. This is useful for tagged paragraphs.
54 .RE
56 .sp
57 .ne 2
58 .na
59 \fB\fB-s\fR\fR
60 .ad
61 .RS 21n
62 Split lines only. Do not join short lines to form longer ones. This prevents
63 sample lines of code, and other such formatted text, from being unduly
64 combined.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fB-w\fR\fI width\fR | \fB-\fR\fIwidth\fR\fR
71 .ad
72 .RS 21n
73 Fill output lines to up to  \fIwidth\fR columns.
74 .RE
76 .SH OPERANDS
77 .sp
78 .ne 2
79 .na
80 \fB\fIinputfile\fR\fR
81 .ad
82 .RS 13n
83 Input file.
84 .RE
86 .SH ENVIRONMENT VARIABLES
87 .sp
88 .LP
89 See \fBenviron\fR(5) for a description of the \fBLC_CTYPE\fR environment
90 variable that affects the execution of \fBfmt\fR.
91 .SH SEE ALSO
92 .sp
93 .LP
94 \fBnroff\fR(1), \fBvi\fR(1), \fBattributes\fR(5), \fBenviron\fR(5)
95 .SH NOTES
96 .sp
97 .LP
98 The \fB-\fR\fIwidth\fR option is acceptable for \fBBSD\fR compatibility, but it
99 may go away in future releases.