The current count of line width shall be decremented by one, although the count never shall become negative. The fold utility shall not insert a immediately before or after any , unless the following character has a width greater than 1 and would cause the line width to exceed width . The current count of line width shall be set to zero. The fold utility shall not insert a immediately before or after any . Each encountered shall advance the column position pointer to the next tab stop. Tab stops shall be at each column position n such that n modulo 8 equals 1. If a segment of a line contains a within the first width column positions (or bytes), break the line after the last such meeting the width constraints. If there is no meeting the requirements, the -s option shall have no effect for that output segment of the input line. The standard input shall be used if no file operands are specified, and shall be used if a file operand is '-' and the implementation treats the '-' as meaning standard input. Otherwise, the standard input shall not be used. See the INPUT FILES section. If the -b option is specified, the input files shall be text files except that the lines are not limited to {LINE MAX} bytes in length. If the -b option is not specified, the input files shall be text files. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files), and for the determination of the width in column positions each character would occupy on a constant-width font output device. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( The standard output shall be a file containing a sequence of characters whose order shall be preserved from the input files, possibly with inserted characters. The cut and fold utilities can be used to create text files out of files with arbitrary line lengths. The cut utility should be used when the number of lines (or records) needs to remain constant. The fold utility should be used when the contents of long lines need to be kept contiguous. The fold utility is frequently used to send text files to printers that truncate, rather than fold, lines wider than the printer is able to print (usually 80 or 132 column positions). Although terminal input in canonical processing mode requires the erase character (frequently set to ) to erase the previous character (not byte or column position), terminal output is not buffered and is extremely difficult, if not impossible, to parse correctly; the interpretation depends entirely on the physical device that actually displays/prints/stores the output. In all known internationalized implementations, the utilities producing output for mixed column-width output assume that a character backs up one column position and outputs enough characters to return to the start of the character when is used to provide local line motions to support underlining and emboldening operations. Since fold without the -b option is dealing with these same constraints, is always treated as backing up one column position rather than backing up one character. The tab stops are hardcoded to be every eighth column to meet historical practice. No new method of specifying other tab stops was invented. The normative text is reworded to avoid use of the term "must" for application requirements.
Excerpt from a page describing this subject · 10,345 chars · not written by Vinony
via Wikidata · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).