xref: /netbsd-src/usr.bin/fold/fold.1 (revision 67717ff652a8772f4987176638aa2d78ba32931e)
1*67717ff6Swiz.\"	$NetBSD: fold.1,v 1.17 2012/05/12 15:17:15 wiz Exp $
2af8b52d6Sjtc.\"
3af8b52d6Sjtc.\" Copyright (c) 1980, 1993
4af8b52d6Sjtc.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
30af8b52d6Sjtc.\"	@(#)fold.1	8.1 (Berkeley) 6/6/93
3161f28255Scgd.\"
32420833faSreed.Dd May 12, 2012
3361f28255Scgd.Dt FOLD 1
3461f28255Scgd.Os
3561f28255Scgd.Sh NAME
3661f28255Scgd.Nm fold
3761f28255Scgd.Nd "fold long lines for finite width output device"
3861f28255Scgd.Sh SYNOPSIS
39c5a3c533Slukem.Nm
40b1c840c3Sjtc.Op Fl bs
4161f28255Scgd.Op Fl w Ar width
42826f78a9Swiz.Op Ar
4361f28255Scgd.Sh DESCRIPTION
44c5a3c533Slukem.Nm
4561f28255Scgdis a filter which folds the contents of the specified files,
4661f28255Scgdor the standard input if no files are specified,
47826f78a9Swizbreaking the lines to have a maximum of 80 characters.
4861f28255Scgd.Pp
4961f28255ScgdThe options are as follows:
504285677dSwiz.Bl -tag -width XwXwidthXX
51a02c58f5Sjtc.It Fl b
52a02c58f5SjtcCount
53a02c58f5Sjtc.Ar width
54a02c58f5Sjtcin bytes rather than column positions.
55a02c58f5Sjtc.It Fl s
56a02c58f5SjtcFold line after the last blank character within the first
57a02c58f5Sjtc.Ar width
58a02c58f5Sjtccolumn positions (or bytes).
59420833faSreedIf a blank character does not exist within the width, then
60420833faSreeda longer line will still be split at the width.
614285677dSwiz.It Fl w Ar width
62826f78a9SwizSpecifies
63826f78a9Swiz.Ar width
64826f78a9Swizto use as a line width, instead of the default 80 characters.
65a02c58f5Sjtc.El
66b05ff95eSahoka.Sh ENVIRONMENT
67b05ff95eSahoka.Bl -tag -width indent
68b05ff95eSahoka.It Ev LC_CTYPE
69b05ff95eSahoka.El
7015a1cc61Sjoerg.Sh EXIT STATUS
7115a1cc61Sjoerg.Ex -std
72a02c58f5Sjtc.Sh SEE ALSO
73826f78a9Swiz.Xr expand 1 ,
74826f78a9Swiz.Xr fmt 1
75b1c840c3Sjtc.Sh STANDARDS
76b1c840c3SjtcThe
77c5a3c533Slukem.Nm
78b1c840c3Sjtcutility conforms to
79b05ff95eSahoka.St -p1003.1-2008 .
8042346787Sreed.Sh HISTORY
8142346787SreedThe
8242346787Sreed.Nm
8342346787Sreedutility appeared in
8442346787Sreed.Bx 1 .
85a02c58f5Sjtc.Sh BUGS
86a02c58f5SjtcIf underlining is present it may be messed up by folding.
87a02c58f5Sjtc.Pp
8861f28255Scgd.Ar Width
8961f28255Scgdshould be a multiple of 8 if tabs are present, or the tabs should
9061f28255Scgdbe expanded using
9161f28255Scgd.Xr expand 1
9261f28255Scgdbefore using
93990562bfSwiz.Nm .
94