1 .\" Copyright (c) 1980, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)fmt.1 8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD: src/usr.bin/fmt/fmt.1,v 1.7.2.3 2002/06/21 15:26:55 charnier Exp $
34 .\" $DragonFly: src/usr.bin/fmt/fmt.1,v 1.3 2007/07/29 17:27:45 swildner Exp $
36 .\" Modified by Gareth McCaughan to describe the new version of `fmt'
37 .\" rather than the old one.
43 .Nd simple text formatter
50 .Op Ar goal Oo Ar maximum Oc | Fl Ns Ar width | Fl w Ar width
55 utility is a simple text formatter which reads the concatenation of input
56 files (or standard input if none are given) and produces on standard
57 output a version of its input with lines as close to the
60 as possible without exceeding the
70 Alternatively, a single
72 parameter can be specified either by prepending a hyphen to it or by using
79 all produce identical output.
80 The spacing at the beginning of the input lines is preserved in the output,
81 as are blank lines and interword spacing.
82 Lines are joined or split only at white space; that is, words are never
85 The options are as follows:
86 .Bl -tag -width indent
88 Center the text, line by line.
89 In this case, most of the other
90 options are ignored; no splitting or joining of lines is done.
92 Try to format mail header lines contained in the input sensibly.
94 Format lines beginning with a
99 does not fill these lines, for compatibility with
102 Allow indented paragraphs.
105 flag, any change in the amount of whitespace at the start of a line
106 results in a new paragraph being begun.
108 Collapse whitespace inside lines, so that multiple whitespace
109 characters are turned into a single space.
111 sentence, a double space.)
115 (and no others) as sentence-ending characters.
117 sentence-ending characters are full stop
123 Remember that some characters may need to be
124 escaped to protect them from your shell.
126 Replace multiple spaces with tabs at the start of each output
130 spaces will be replaced with one tab.
134 is 0, spaces are preserved.
136 Assume that the input files' tabs assume
145 is meant to format mail messages prior to sending, but may also be useful
146 for other simple tasks.
148 within visual mode of the
156 will reformat a paragraph,
167 The version described herein is a complete rewrite and appeared in
177 The program was designed to be simple and fast \- for more complex
178 operations, the standard text processors are likely to be more appropriate.
180 When the first line of an indented paragraph is very long (more than
181 about twice the goal length), the indentation in the output can be
186 utility is not infallible in guessing what lines are mail headers and what