Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fmt(1) [opensolaris man page]

fmt(1)								   User Commands							    fmt(1)

NAME
fmt - simple text formatters SYNOPSIS
fmt [-cs] [-w width | -width] [inputfile]... DESCRIPTION
fmt is a simple text formatter that fills and joins lines to produce output lines of (up to) the number of characters specified in the -w width option. The default width is 72. fmt concatenates the inputfiles listed as 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 fill nor split lines beginning with a `.' (dot), for compatibility with nroff(1). Nor does it fill or split a set of contiguous non-blank lines which is determined to be a mail header, the first line of which must begin with "From". Indentation is preserved in the output, and input lines with differing indentation are not joined (unless -c is used). fmt can also be used as an in-line text filter for vi(1). The vi command: !}fmt reformats the text between the cursor location and the end of the paragraph. OPTIONS
-c Crown margin mode. Preserve the indentation of the first 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. -s Split lines only. Do not join short lines to form longer ones. This prevents sample lines of code, and other such for- matted text, from being unduly combined. -w width | -width Fill output lines to up to width columns. OPERANDS
inputfile Input file. ENVIRONMENT VARIABLES
See environ(5) for a description of the LC_CTYPE environment variable that affects the execution of fmt. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
nroff(1), vi(1), attributes(5), environ(5) NOTES
The -width option is acceptable for BSD compatibility, but it may go away in future releases. SunOS 5.11 9 May 1997 fmt(1)

Check Out this Related Man Page

fmt(1)							      General Commands Manual							    fmt(1)

NAME
fmt - Formats mail messages prior to sending SYNOPSIS
fmt [-width] file... DESCRIPTION
The fmt command reads the input file or files, or standard input if no files are specified, and writes to standard output a version of the input with lines of a length as close as possible to width columns. (Because fmt is internationalized software, the number of display col- umns is not necessarily equivalent to the number of bytes.) The fmt command both joins and splits lines to achieve the desired width, but words are never joined or split; spaces are always preserved, and lines are split at spaces only. In effect, fmt ignores newline characters in the input and wraps words to make lines a close as possi- ble to width columns, resulting in individual lines of varying length but a consistent (new) text width overall. Because blank lines are always preserved, fmt does not merge paragraphs separated by blank lines. If you specify more than one file, the files are concatenated as input to fmt. If you do not specify -width, the default line length is 72 columns. Spacing at the beginning of input lines is always preserved in the output. The fmt command is generally used to format mail messages to improve their appearance before they are sent. It may also be useful, how- ever, for other simple formatting tasks. For example, when you are using vi, you can use the command :%!fmt -60 to reformat your text so that all lines are approximately 60 columns long. NOTES
The fmt command is a fast, simple formatting program. Standard text editing programs are more appropriate than fmt for complex formatting operations. Do not use the fmt command if the message contains embedded messages or preformatted information from other files. This com- mand formats the heading information in embedded messages and may change the format of preformatted information. EXAMPLES
file1 contains these lines: Australia is an island-continent, home to many very interesting plants and animals. To reformat this text to a narrower width, enter: fmt -30 file1 This results in the following, displayed on your screen: Australia is an island-continent, home to many very interesting plants and animals. To make file1 wider, enter: fmt -60 file1 This results in: Australia is an island-continent, home to many very interesting plants and animals. To format a message you have created with the mailx editor, at the left margin enter: ~|fmt After you enter the command, your message is formatted, in this case to the default line length of 72 columns, and the word continue is displayed to indicate that you can enter more information or send your message. SEE ALSO
Commands: mail(1), mailx(1), vi(1) fmt(1)
Man Page