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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)fmt.1 8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD: head/usr.bin/fmt/fmt.1 216370 2010-12-11 08:32:16Z joel $
31 .\" Modified by Gareth McCaughan to describe the new version of `fmt'
32 .\" rather than the old one.
38 .Nd simple text formatter
45 .Op Ar goal Oo Ar maximum Oc | Fl Ns Ar width | Fl w Ar width
50 utility is a simple text formatter which reads the concatenation of input
51 files (or standard input if none are given) and produces on standard
52 output a version of its input with lines as close to the
55 as possible without exceeding the
65 Alternatively, a single
67 parameter can be specified either by prepending a hyphen to it or by using
74 all produce identical output.
75 The spacing at the beginning of the input lines is preserved in the output,
76 as are blank lines and interword spacing.
77 Lines are joined or split only at white space; that is, words are never
80 The options are as follows:
81 .Bl -tag -width indent
83 Center the text, line by line.
84 In this case, most of the other
85 options are ignored; no splitting or joining of lines is done.
87 Try to format mail header lines contained in the input sensibly.
89 Format lines beginning with a
94 does not fill these lines, for compatibility with
97 Allow indented paragraphs.
100 flag, any change in the amount of whitespace at the start of a line
101 results in a new paragraph being begun.
103 Collapse whitespace inside lines, so that multiple whitespace
104 characters are turned into a single space.
106 sentence, a double space.)
110 (and no others) as sentence-ending characters.
112 sentence-ending characters are full stop
118 Remember that some characters may need to be
119 escaped to protect them from your shell.
121 Replace multiple spaces with tabs at the start of each output
125 spaces will be replaced with one tab.
129 is 0, spaces are preserved.
131 Assume that the input files' tabs assume
140 is meant to format mail messages prior to sending, but may also be useful
141 for other simple tasks.
143 within visual mode of the
151 will reformat a paragraph,
158 environment variables affect the execution of
172 The version described herein is a complete rewrite and appeared in
182 The program was designed to be simple and fast \- for more complex
183 operations, the standard text processors are likely to be more appropriate.
185 When the first line of an indented paragraph is very long (more than
186 about twice the goal length), the indentation in the output can be
191 utility is not infallible in guessing what lines are mail headers and what