fold(1) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

fold(1)

fold(1)                          User Commands                         fold(1)



NAME
       fold - filter for folding lines

SYNOPSIS
       fold [-b | --bytes] [-s | --spaces] [-c | --characters]
                  [-w | --width width ] [-width] [--help] [file]...

DESCRIPTION
       The  fold  utility  is  a filter that folds lines from its input files,
       breaking the lines to have a maximum  of  width  column  positions  (or
       bytes,  if  the -b option is specified). Lines are broken by the inser‐
       tion of a NEWLINE character such that each  output  line  (referred  to
       later  in this section as a segment) is the maximum width possible that
       does not exceed the specified number of column positions (or bytes).  A
       line  is not broken in the middle of a character. The behavior is unde‐
       fined if width is less than the number of columns any single  character
       in the input would occupy.


       The -b and -c options are mutually exclusive and only one may be speci‐
       fied.


       If the CARRIAGE-RETURN, BACKSPACE, or TAB characters are encountered in
       the  input,  and  the -b option is not specified, they are treated spe‐
       cially:

       BACKSPACE          The current count of line width  is  decremented  by
                          one, although the count never becomes negative. fold
                          does not  insert  a  NEWLINE  character  immediately
                          before or after any BACKSPACE character.


       CARRIAGE-RETURN    The  current  count  of line width is set to 0. fold
                          does not  insert  a  NEWLINE  character  immediately
                          before or after any CARRIAGE-RETURN character.


       TAB                Each  TAB  character encountered advances the column
                          position pointer to the next tab stop. Tab stops are
                          at  each  column  position  n  such  that n modulo 8
                          equals 1.


OPTIONS
       The following options are supported:

       -b, --bytes

           Counts width in bytes rather than  column  positions.  May  not  be
           specified with -c option.


       -s, --space

           If  a segment of a line contains a blank character within the first
           width column positions (or bytes), breaks the line after  the  last
           such  blank character meeting the width constraints. If there is no
           blank character meeting the requirements,  the  -s  option  has  no
           effect for that output segment of the input line.


       -c, --characters

           Counts width in characters rather than column positions. May not be
           specified with -b option.


       -w width | --width width | -width

           Specifies the maximum line length, in column positions (or bytes if
           -b  is specified, or characters for -c). If width is not a positive
           decimal number, an error is returned. The default value is 80.


       --help

           Print usage statement and exit.


OPERANDS
       The following operand is supported:

       file    A path name of a text file to be folded. If  no  file  operands
               are specified, the standard input is used.


ENVIRONMENT VARIABLES
       See  environ(7) for descriptions of the following environment variables
       that affect the execution of fold: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
       and NLSPATH.

EXIT STATUS
       The following exit values are returned:

       0     All input files were processed successfully.


       >0    An error occurred.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/core-os  _  CSIenabled  _  Interface
       StabilityCommitted _ StandardSee standards(7).


SEE ALSO
       cut(1), pr(1), attributes(7), environ(7), standards(7)

NOTES
       fold  and  cut(1)  can  be  used to create text files out of files with
       arbitrary line lengths. fold should be used when the contents  of  long
       lines need to be kept contiguous. cut should be used when the number of
       lines (or records) needs to remain constant.


       fold is frequently used to send text files to line printers that  trun‐
       cate,  rather  than fold, lines wider than the printer is able to print
       (usually 80 or 132 column positions).


       fold might not work correctly if underlining is present.



Oracle Solaris 11.4               17 Aug 2011                          fold(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3