Annotation of src/usr.bin/split/split.1, Revision 1.8
1.8 ! mickey 1: .\" $OpenBSD: split.1,v 1.7 2001/09/06 15:04:34 mpech 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.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" @(#)split.1 8.3 (Berkeley) 4/16/94
36: .\"
37: .Dd April 16, 1994
38: .Dt SPLIT 1
39: .Os
40: .Sh NAME
41: .Nm split
42: .Nd split a file into pieces
43: .Sh SYNOPSIS
44: .Nm split
45: .Op Fl b Ar byte_count[k|m]
46: .Op Fl l Ar line_count
1.3 millert 47: .Op Fl p Ar pattern
1.1 deraadt 48: .Op Ar file Op Ar name
49: .Sh DESCRIPTION
50: The
1.5 aaron 51: .Nm
1.1 deraadt 52: utility reads the given
53: .Ar file
54: (or standard input if no file is specified)
55: and breaks it up into files of 1000 lines each.
56: .Pp
57: The options are as follows:
58: .Bl -tag -width Ds
59: .It Fl b
60: Create smaller files
61: .Ar byte_count
62: bytes in length.
63: If
1.5 aaron 64: .Sq k
1.1 deraadt 65: is appended to the number, the file is split into
66: .Ar byte_count
67: kilobyte pieces.
68: If
1.5 aaron 69: .Sq m
1.1 deraadt 70: is appended to the number, the file is split into
71: .Ar byte_count
72: megabyte pieces.
73: .It Fl l
74: Create smaller files
75: .Ar n
76: lines in length.
1.3 millert 77: .It Fl p Ar pattern
78: The file is split whenever an input line matches
79: .Ar pattern ,
80: which is interpreted as an extended regular expression.
81: The matching line will be the first line of the next output file.
82: This option is incompatible with the
83: .Fl b
84: and
85: .Fl l
86: options.
1.1 deraadt 87: .El
88: .Pp
89: If additional arguments are specified, the first is used as the name
90: of the input file which is to be split.
91: If a second additional argument is specified, it is used as a prefix
92: for the names of the files into which the file is split.
93: In this case, each file into which the file is split is named by the
1.4 aaron 94: prefix followed by a lexically ordered suffix in the range of
1.5 aaron 95: .Dq aa-zz .
1.1 deraadt 96: .Pp
97: If the
98: .Ar name
99: argument is not specified, the file is split into lexically ordered
100: files named in the range of
1.5 aaron 101: .Dq xaa-zzz .
1.6 aaron 102: .Sh SEE ALSO
1.7 mpech 103: .Xr re_format 7
1.6 aaron 104: .Sh HISTORY
105: A
106: .Nm
107: command appeared in
1.8 ! mickey 108: .At v3 .
1.1 deraadt 109: .Sh BUGS
110: For historical reasons, if you specify
111: .Ar name ,
1.5 aaron 112: .Nm
1.1 deraadt 113: can only create 676 separate
114: files.
115: The default naming convention allows 2028 separate files.
1.3 millert 116: .Pp
117: The maximum line length for matching patterns is 65536.