fold(1)
NAME
fold − fold long lines for finite width output device
SYNOPSIS
fold [−s] [−w width] [file ...]
Obsolete form:
fold [−s] [−width] [file ...]
DESCRIPTION
fold is a filter that folds the contents of the specified files, breaking the lines to have maximum width width. If no files are specified or if a file name of − is specified, the standard input is used.
If backspace or tab characters are encountered in the input, they are treated specially.
Backspace The current count of line width is decremented by one, although the count never becomes negative. Thus, the character sequence character-backspace-character counts as using one column position, assuming both characters each occupy a single column position.
Tab Each tab character encountered advances the column position pointer to the next tab stop. Tab stops are set 8 columns apart at column positions 1, 9, 17, 25, 33, etc.
Options
−s Break the line on the last blank character found before the specified number of column positions. If none are found, break the line at the specified line length.
−w width
−width Specify the maximum line length, in column positions. Default is 80. width should be a multiple of 8 if tabs are present, or the tabs should be expanded using expand(1) before processing by fold. The −width option is obsolescent and may be removed in a future HP-UX release.
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines the interpretation of text as single and/or multi-byte characters.
If LC_CTYPE is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, fold behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
SEE ALSO
STANDARDS CONFORMANCE
fold: proposed POSIX.2 FIPS (June 1990)
Hewlett-Packard Company — HP-UX Release 8.05: June 1991