MAN page from RedHat Other textutils-1.22-1.1.i386.rpm
FMT
Section: User Commands (1)
Updated: GNU Text Utilities
Index NAME
fmt - simple optimal text formatter
SYNOPSIS
fmt[-cstu] [-width] [-w width] [-p prefix][--crown-margin][--split-only][--tagged-paragraph][--uniform-spacing][--width=width][--prefix=prefix][--help][--version][file ...]
DESCRIPTION
This documentation is no longer being maintained and may be inaccurateor incomplete. The Texinfo documentation is now the authoritative source.
This manual page documents the GNU version offmt.fmtis a simple text formatter thatfills and joins lines to produce output lines of (up to) the specifiedwidth(default 75).Howeverfmtuses a best-fit line breaking algorithm, by a simple version of``Breaking Paragraphs into Lines'',Donald E. Knuth and Michael F. Plass,Software---Practice and Experience11(1981) 1119-1184.
fmtconcatenates thefileslisted as arguments. If none are given,fmtformats text from the standard input.
Blank lines are preserved in the output, as is the spacing between words(unless-uis used).In contrast to BSDfmt,tabs are expanded on input and re-introduced on output.
Indentation is preserved in the output, and input lines with differingindentation are not joined (unless-cor-tis used).Note that although the BSDfmtmanual also states this,the BSD version does in fact join following lines with less indentation.
fmt prefers breaking lines at the end of a sentence,and tries to avoid line breaks after the first word of a sentenceor before the last word of a sentence.A sentence break is defined as either the end of a paragraph or a word endingin [.?!], followed by two spaces or end of line,ignoring any intervening parentheses or quotes.
OPTIONS
- -c, --crown-margin
- Crown margin mode.Preserve the indentation of the first two lines within a paragraph, andalign the left margin of each subsequent line with that of the second line.
- -t, --tagged-paragraph
- Tagged paragraph mode:just like crown mode, except thatthe indentation of the first line of a paragraph must be differentfrom the indentation of the second.Otherwise the first line is treated as a one-line paragraph.
- -s, --split-only
- Split lines only. Do not join short lines to form longer ones.This prevents sample lines of code, and other such ``formatted'' text,from being unduly combined.
- -u, --uniform-spacing
- Uniform spacing.Reduce spacing between words to one space, except at the end of a sentence(two spaces).
- -width, -w width, --width=width
- Fill output lines to up to width columns(default 75).fmt prefers to make lines about 7% shorter, to give it room to balance linelengths.
- -p, --prefix=prefix
- Only lines beginning with the prefix (possibly preceded by whitespace) are re-arranged; the prefix (with any preceding whitespace) is stripped for the formatting and re-attached to eachformatted output line.One use is to format certain kinds of program comments,while leaving the code unchanged.
- --help
- Print a usage message and exit with a status code indicating success.
- --version
- Print version information on standard output then exit.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- OPTIONS
This document was created byman2html,using the manual pages.