FMT(1) BSD Reference Manual FMT(1)NAMEfmt - simple text formatter
SYNOPSISfmt [-d] [goal [maximum]] [name ...]
DESCRIPTION
Fmt is a simple text formatter which reads the concatenation of input
files (or standard input if none are given) and produces on standard out-
put a version of its input with lines as close to the goal length as pos-
sible without exceeding the maximum. The goal length defaults to 65 and
the maximum to 75. The spacing at the beginning of the input lines is
preserved in the output, as are blank lines and interword spacing.
Fmt is meant to format mail messages prior to sending, but may also be
useful for other simple tasks. For instance, within visual mode of the
ex(1) editor (e.g. vi(1)) the command
!}fmt
will reformat a paragraph, evening the lines.
Fmt supports one option:
-d Don't break text at lines that begin with a dot (`.'). Fmt
normally preserves line breaks before and after input lines
that begin with a dot so that nroff(1) commands can be passed
through unchanged.
Fmt looks for certain mail header lines in the input and preserves line
breaks before and after them. The rules are fairly restrictive. Fmt
will preserve a line break before and after a traditional Unix mail head-
er line that begins with `From ' and contains a sender and a date. It is
not necessary for this line to be preceded by a blank line in the input.
If a line beginning with `To', `Subject' or `Cc' is found within 2 input
lines after a `From ' line, fmt preserves line breaks before and after
such lines.
Fmt recognizes certain sentence-ending punctuation marks at the ends of
input lines, and ensures that they will be padded by two spaces in run-
ning output text instead of the usual one space. The recognized marks
are `.', `:', `!' and `?'.
Fmt takes into account any overstriking or underlining with backspaces
when calculating output line length.
If consecutive input lines have a common indentation, fmt preserves that
indentation in the output. If the indentation increases, or if it de-
creases by more than 8 character positions, fmt breaks output lines.
This allows fmt to fill most indented paragraphs correctly, and to fill
consecutive indented input lines correctly as well.
SEE ALSOnroff(1), mail(1)HISTORY
The fmt command appeared in 3BSD.
BUGS
The program was designed to be simple and fast - for more complex opera-
tions, the standard text processors are likely to be more appropriate.
File names that look like numbers can be mistaken for the goal or maximum
parameters.
The mail header rules are arcane.
BSDI BSD/OS April 9, 1998 2