diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2006-08-09 12:04:22 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2006-08-09 12:04:22 +0000 |
commit | 3176f3516d0d0f1fe20ed62ee1888a7c967b41e0 (patch) | |
tree | 77aec8f83f787be2092ca43ad15ebe9222ba09d0 | |
parent | d7c6f6ee0f54bad44c5bd3404c235712a18369de (diff) |
- indicate that -b, -l, and -p are mutually exclusive
- tidy up the text somewhat
- make it clear that the original file is not changed
mostly this is based on a freebsd pr (33852),
submitted by gary w. swearingen
-rw-r--r-- | usr.bin/split/split.1 | 29 | ||||
-rw-r--r-- | usr.bin/split/split.c | 6 |
2 files changed, 16 insertions, 19 deletions
diff --git a/usr.bin/split/split.1 b/usr.bin/split/split.1 index 8069d3cffe4..82c7f73ee19 100644 --- a/usr.bin/split/split.1 +++ b/usr.bin/split/split.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: split.1,v 1.10 2005/09/07 12:45:59 jmc Exp $ +.\" $OpenBSD: split.1,v 1.11 2006/08/09 12:04:21 jmc Exp $ .\" $NetBSD: split.1,v 1.5 1994/12/21 08:20:35 jtc Exp $ .\" .\" Copyright (c) 1990, 1991, 1993, 1994 @@ -41,19 +41,21 @@ .Oo .Fl b .Sm off -.Ar byte_count Op Ar k | m +.Ar byte_count Op Cm k \*(Ba m .Sm on +.No \*(Ba Fl l Ar line_count +.No \*(Ba Fl p Ar pattern .Oc -.Op Fl l Ar line_count -.Op Fl p Ar pattern .Op Ar file Op Ar name .Sh DESCRIPTION The .Nm utility reads the given -.Ar file -(or standard input if no file is specified) +.Ar file , +or standard input if no file is specified, and breaks it up into files of 1000 lines each. +.Ar file +itself is not altered. .Pp The options are as follows: .Bl -tag -width Ds @@ -61,7 +63,7 @@ The options are as follows: .Fl b .Sm off .Ar byte_count -.Op Ar k | m +.Op Cm k \*(Ba m .Sm on .Xc Create smaller files @@ -86,21 +88,16 @@ The file is split whenever an input line matches .Ar pattern , which is interpreted as an extended regular expression. The matching line will be the first line of the next output file. -This option is incompatible with the -.Fl b -and -.Fl l -options. .El .Pp -If additional arguments are specified, the first is used as the name -of the input file which is to be split. -If a second additional argument is specified, it is used as a prefix +If +.Ar name +is specified, +it is used as a prefix for the names of the files into which the file is split. In this case, each file into which the file is split is named by the prefix followed by a lexically ordered suffix in the range of .Dq aa-zz . -.Pp If the .Ar name argument is not specified, the file is split into lexically ordered diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index 53b46ab347f..1513afbf820 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -1,4 +1,4 @@ -/* $OpenBSD: split.c,v 1.10 2005/09/07 12:45:59 jmc Exp $ */ +/* $OpenBSD: split.c,v 1.11 2006/08/09 12:04:21 jmc Exp $ */ /* $NetBSD: split.c,v 1.5 1995/08/31 22:22:05 jtc Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)split.c 8.3 (Berkeley) 4/25/94"; #else -static char rcsid[] = "$OpenBSD: split.c,v 1.10 2005/09/07 12:45:59 jmc Exp $"; +static char rcsid[] = "$OpenBSD: split.c,v 1.11 2006/08/09 12:04:21 jmc Exp $"; #endif #endif /* not lint */ @@ -311,7 +311,7 @@ usage(void) extern char *__progname; (void)fprintf(stderr, -"usage: %s [-b byte_count[k|m]] [-l line_count] [-p pattern] [file [name]]\n", +"usage: %s [-b byte_count[k|m] | -l line_count | -p pattern] [file [name]]\n", __progname); exit(EX_USAGE); } |