View | Details | Raw Unified | Return to bug 33852
Collapse All | Expand All

(-)/tmp/split.1 (-14 / +13 lines)
Lines 40-56 Link Here
40
.Nd split a file into pieces
40
.Nd split a file into pieces
41
.Sh SYNOPSIS
41
.Sh SYNOPSIS
42
.Nm
42
.Nm
43
.Op Fl b Ar byte_count[k|m]
43
.Op Fl b Ar byte_count[k|m] | Fl l Ar line_count | Fl p Ar pattern
44
.Op Fl l Ar line_count
44
.Op Ar filename Op Ar prefix
45
.Op Fl p Ar pattern
46
.Op Ar file Op Ar name
47
.Sh DESCRIPTION
45
.Sh DESCRIPTION
48
The
46
The
49
.Nm
47
.Nm
50
utility reads the given
48
utility reads file
51
.Ar file
49
.Ar filename
52
(or standard input if no file is specified)
50
(or standard input if no file is specified)
53
and breaks it up into files of 1000 lines each.
51
and breaks it up into files of 1000 lines
52
(or an optionally specified size) each, leaving file
53
.Ar filename
54
unchanged.
55
No padding is added, so the last new file is normally smaller than the
56
others and proper catenation of the output files creates a copy of the
57
unsplit original.
54
.Pp
58
.Pp
55
The options are as follows:
59
The options are as follows:
56
.Bl -tag -width Ds
60
.Bl -tag -width Ds
Lines 77-87 Link Here
77
.Ar pattern ,
81
.Ar pattern ,
78
which is interpreted as an extended regular expression.
82
which is interpreted as an extended regular expression.
79
The matching line will be the first line of the next output file.
83
The matching line will be the first line of the next output file.
80
This option is incompatible with the
81
.Fl b
82
and
83
.Fl l
84
options.
85
.El
84
.El
86
.Pp
85
.Pp
87
If additional arguments are specified, the first is used as the name
86
If additional arguments are specified, the first is used as the name
Lines 93-105 Link Here
93
.Dq Li aa-zz .
92
.Dq Li aa-zz .
94
.Pp
93
.Pp
95
If the
94
If the
96
.Ar name
95
.Ar prefix
97
argument is not specified, the file is split into lexically ordered
96
argument is not specified, the file is split into lexically ordered
98
files named in the range of
97
files named in the range of
99
.Dq Li xaa-zzz .
98
.Dq Li xaa-zzz .
100
.Sh BUGS
99
.Sh BUGS
101
For historical reasons, if you specify
100
For historical reasons, if you specify
102
.Ar name ,
101
.Ar prefix ,
103
.Nm
102
.Nm
104
can only create 676 separate
103
can only create 676 separate
105
files.
104
files.
(-)/tmp/split.c (-1 / +1 lines)
Lines 312-317 Link Here
312
usage()
312
usage()
313
{
313
{
314
	(void)fprintf(stderr,
314
	(void)fprintf(stderr,
315
"usage: split [-b byte_count] [-l line_count] [-p pattern] [file [prefix]]\n");
315
"usage: split [-b byte_count | -l line_count | -p pattern] [filename [prefix]]\n");
316
	exit(EX_USAGE);
316
	exit(EX_USAGE);
317
}
317
}

Return to bug 33852