f

fmt(1)fmt(1)

NAME

fmt - format text

SYNOPSIS

fmt [-cs] [-wwidth] [®le...]

DESCRIPTION

The fmt command is a simple text formatter that ®lls and joins lines to produce output lines of (up to) the number of characters speci®ed in the -wwidth option. The default width is 72. fmt concatenates the file arguments. If none are given, fmt formats text from the standard input.

Blank lines are preserved in the output, as is the spacing between words. fmt does not ®ll lines beginning with a period (.), for compatibility with nroff. Nor does it ®ll lines starting with From:.

Indentation is preserved in the output and input lines with differing indentation are not joined (unless -cis used).

fmt can also be used as an in-line text ®lter for vi; the vi command:

!}fmt

reformats the text between the cursor location and the end of the paragraph.

Options

fmt recognizes the following options:

-cCrown margin mode. Preserve the indentation of the ®rst two lines within a paragraph and align the left margin of each subsequent line with that of the second line. This is useful for tagged paragraphs.

-sSplit 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.

-wFill output lines to up to width columns.

WARNINGS

The -wwidth option is acceptable for BSD compatibility, but it may go away in future releases.

SEE ALSO nroff(1), vi(1).

Section 1282

− 1 −

HP-UX Release 11i: December 2000