Annotation of src/usr.bin/split/split.1, Revision 1.18
1.18 ! jmc 1: .\" $OpenBSD: split.1,v 1.17 2008/01/05 09:30:36 jmc Exp $
1.1 deraadt 2: .\" $NetBSD: split.1,v 1.5 1994/12/21 08:20:35 jtc Exp $
3: .\"
4: .\" Copyright (c) 1990, 1991, 1993, 1994
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.9 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)split.1 8.3 (Berkeley) 4/16/94
32: .\"
1.18 ! jmc 33: .Dd $Mdocdate: January 5 2008 $
1.1 deraadt 34: .Dt SPLIT 1
35: .Os
36: .Sh NAME
37: .Nm split
38: .Nd split a file into pieces
39: .Sh SYNOPSIS
40: .Nm split
1.12 millert 41: .Op Fl a Ar suffix_length
42: .br
1.10 jmc 43: .Oo
44: .Fl b
45: .Sm off
1.11 jmc 46: .Ar byte_count Op Cm k \*(Ba m
1.10 jmc 47: .Sm on
1.11 jmc 48: .No \*(Ba Fl l Ar line_count
49: .No \*(Ba Fl p Ar pattern
1.10 jmc 50: .Oc
1.1 deraadt 51: .Op Ar file Op Ar name
52: .Sh DESCRIPTION
53: The
1.5 aaron 54: .Nm
1.1 deraadt 55: utility reads the given
1.11 jmc 56: .Ar file ,
57: or standard input if no file is specified,
58: and breaks it up into files of 1000 lines each.
1.1 deraadt 59: .Ar file
1.11 jmc 60: itself is not altered.
1.1 deraadt 61: .Pp
62: The options are as follows:
63: .Bl -tag -width Ds
1.12 millert 64: .It Fl a Ar suffix_length
65: Use
66: .Ar suffix_length
67: letters to form the suffix of the file name
68: (see below).
69: The default suffix length is 2.
1.10 jmc 70: .It Xo
71: .Fl b
72: .Sm off
73: .Ar byte_count
1.11 jmc 74: .Op Cm k \*(Ba m
1.10 jmc 75: .Sm on
76: .Xc
1.17 jmc 77: Create files
1.1 deraadt 78: .Ar byte_count
79: bytes in length.
80: If
1.5 aaron 81: .Sq k
1.1 deraadt 82: is appended to the number, the file is split into
83: .Ar byte_count
84: kilobyte pieces.
85: If
1.5 aaron 86: .Sq m
1.1 deraadt 87: is appended to the number, the file is split into
88: .Ar byte_count
89: megabyte pieces.
1.10 jmc 90: .It Fl l Ar line_count
1.17 jmc 91: Create files
1.10 jmc 92: .Ar line_count
1.1 deraadt 93: lines in length.
1.3 millert 94: .It Fl p Ar pattern
95: The file is split whenever an input line matches
96: .Ar pattern ,
97: which is interpreted as an extended regular expression.
98: The matching line will be the first line of the next output file.
1.12 millert 99: This option is incompatible with the
100: .Fl b
101: and
102: .Fl l
103: options.
1.1 deraadt 104: .El
105: .Pp
1.11 jmc 106: If
107: .Ar name
108: is specified,
109: it is used as a prefix
1.1 deraadt 110: for the names of the files into which the file is split.
111: In this case, each file into which the file is split is named by the
1.12 millert 112: prefix followed by a lexically ordered suffix using
113: .Ar suffix_length
114: characters in the range
115: .Dq a-z .
116: .Pp
1.1 deraadt 117: If the
118: .Ar name
119: argument is not specified, the file is split into lexically ordered
1.12 millert 120: files named with the prefixes
1.13 jmc 121: .Sq x ,
122: .Sq y ,
1.12 millert 123: and
1.13 jmc 124: .Sq z .
1.6 aaron 125: .Sh SEE ALSO
1.14 jmc 126: .Xr csplit 1 ,
1.7 mpech 127: .Xr re_format 7
1.12 millert 128: .Sh STANDARDS
129: The
130: .Nm
131: utility is compliant with the
1.18 ! jmc 132: .St -p1003.1-2008
1.12 millert 133: specification.
1.15 jmc 134: .Pp
135: The flag
136: .Op Fl p
137: is an extension to that specification.
1.12 millert 138: .Pp
139: The use of
1.13 jmc 140: .Sq y
1.12 millert 141: and
1.13 jmc 142: .Sq z
1.12 millert 143: prefixes (in addition to the standard
1.13 jmc 144: .Sq x )
1.12 millert 145: in the absence of a
146: .Ar name
147: parameter is an
148: .Ox
149: extension.
1.6 aaron 150: .Sh HISTORY
151: A
152: .Nm
153: command appeared in
1.8 mickey 154: .At v3 .
1.1 deraadt 155: .Sh BUGS
1.3 millert 156: The maximum line length for matching patterns is 65536.