IPB
>  Man Pages > Unix > Solaris 10 11/06 > Section 1 > fold man page

fold man page

Section 1 - Solaris 10 11/06 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!





User Commands                                             fold(1)



NAME
     fold - filter for folding lines

SYNOPSIS
     fold [-bs] [-w width | -width]  [file...]

DESCRIPTION
     The fold utility is a filter that will fold 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 will be broken by the insertion of a NEWLINE character
     such that each output line (referred to later in  this  sec-
     tion  as  a segment) is the maximum width possible that does
     not exceed the specified  number  of  column  positions  (or
     bytes). A line will not be broken in the middle of a charac-
     ter. The behavior is undefined if width  is  less  than  the
     number  of  columns  any single character in the input would
     occupy.

     If the CARRIAGE-RETURN, BACKSPACE,  or  TAB  characters  are
     encountered  in  the  input, and the -b option is not speci-
     fied, they will be treated specially:

     BACKSPACE               The current count of line width will
                             be  decremented by one, although the
                             count never  will  become  negative.
                             fold will not insert a NEWLINE char-
                             acter immediately  before  or  after
                             any BACKSPACE character.



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



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



OPTIONS
     The following options are supported:





SunOS 5.10           Last change: 1 Feb 1995                    1






User Commands                                             fold(1)



     -b              Counts width in  bytes  rather  than  column
                     positions.



     -s              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 will have no effect for  that  output
                     segment of the input line.



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



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 will be
              used.



EXAMPLES
     Example 1: Submitting a file of possibly long lines  to  the
     line printer

     An example invocation that submits a file of  possibly  long
     lines  to  the  line  printer (under the assumption that the
     user knows the line width of the printer to be  assigned  by
     lp(1)):

     example% fold -w 132 bigfile | lp

ENVIRONMENT VARIABLES
     See environ(5) 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:





SunOS 5.10           Last change: 1 Feb 1995                    2






User Commands                                             fold(1)



     0        All input files were processed successfully.



     >0       An error occurred.



ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWcsu                     |
    |_____________________________|_____________________________|
    | CSI                         | enabled                     |
    |_____________________________|_____________________________|
    | Interface Stability         | Standard                    |
    |_____________________________|_____________________________|


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

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  truncate,  rather  than  fold,  lines  wider  than the
     printer is able to print (usually 80  or  132  column  posi-
     tions).

     fold may not work correctly if underlining is present.
















SunOS 5.10           Last change: 1 Feb 1995                    3





Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Wed Sep 12 11:24:42 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

sqlite3 man page (5333 hits)
(openSUSE 10.2)

svn man page (5208 hits)
(FreeBSD 6.2)

adv_cap_autoneg man page (4870 hits)
(Solaris 10 11_06)

CPAN man page (4607 hits)
(Suse Linux 10.1)

ssh man page (4342 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (2874 hits)
(Solaris 10 11_06)

netcat man page (2717 hits)
(Suse Linux 10.1)

pprosetup man page (2487 hits)
(Solaris 10 11_06)

startproc man page (2471 hits)
(Suse Linux 10.1)

signal man page (2406 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: About Pyrenees Mountain Holidays :: Electronic Design Bedfordshire :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum