Skip site navigation (1)Skip section navigation (2)
Date:      13 Jan 2002 17:01:54 -0800
From:      "Gary W. Swearingen" <swear@blarg.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   docs/33852: split(1) man page implies that input file is removed.
Message-ID:  <3hzo3hwxrx.o3h@localhost.localdomain>

next in thread | raw e-mail | index | archive | help

>Number:         33852
>Category:       docs
>Synopsis:       split(1) man page implies that input file is removed.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 13 17:00:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gary W. Swearingen
>Release:        FreeBSD 4.5-PRERELEASE i386
>Organization:
none
>Environment:
n/a
================
>Description:

1) The split(1) man page can leave some readers wondering whether the
input file itself (or a copy of it) is split into the output files.
That is, does "split" remove the input file? (After splitting a log,
the whole log is gone.)

2) The synopsis line implies that the -b, -l, and -p options may be
used together and the -p option's description only partially clarifies
the fact that only one of those options may be used successfully.

3) The page's use of "file" for a filename and "name" for a prefix is
not as clear as it could be.
================
>How-To-Repeat:
n/a
================
>Fix:

1) Change wording.
2) Change first SYNOPSIS line from
    split [-b byte_count[k|m]] [-l line_count] [-p pattern]
to
    split [-b byte_count[k|m] | -l line_count | -p pattern]
3) Change words.

NOTE: I've put a one-line patch for split.c at the end to make "usage"
match "SYNOPSIS".  If nobody wants to use it now, I can write a PR for
it later.

--- /tmp/split..orig.1	Sun Jan 13 13:59:09 2002
+++ /tmp/split.1	Sun Jan 13 15:11:33 2002
@@ -40,17 +40,21 @@
 .Nd split a file into pieces
 .Sh SYNOPSIS
 .Nm
-.Op Fl b Ar byte_count[k|m]
-.Op Fl l Ar line_count
-.Op Fl p Ar pattern
-.Op Ar file Op Ar name
+.Op Fl b Ar byte_count[k|m] | Fl l Ar line_count | Fl p Ar pattern
+.Op Ar filename Op Ar prefix
 .Sh DESCRIPTION
 The
 .Nm
-utility reads the given
-.Ar file
+utility reads file
+.Ar filename
 (or standard input if no file is specified)
-and breaks it up into files of 1000 lines each.
+and breaks it up into files of 1000 lines
+(or an optionally specified size) each, leaving file
+.Ar filename
+unchanged.
+No padding is added, so the last new file is normally smaller than the
+others and proper catenation of the output files creates a copy of the
+unsplit original.
 .Pp
 The options are as follows:
 .Bl -tag -width Ds
@@ -77,11 +81,6 @@
 .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
@@ -93,13 +92,13 @@
 .Dq Li aa-zz .
 .Pp
 If the
-.Ar name
+.Ar prefix
 argument is not specified, the file is split into lexically ordered
 files named in the range of
 .Dq Li xaa-zzz .
 .Sh BUGS
 For historical reasons, if you specify
-.Ar name ,
+.Ar prefix ,
 .Nm
 can only create 676 separate
 files.
--- /tmp/split..orig.c	Sun Jan 13 15:13:54 2002
+++ /tmp/split.c	Sun Jan 13 15:18:26 2002
@@ -312,6 +312,6 @@
 usage()
 {
 	(void)fprintf(stderr,
-"usage: split [-b byte_count] [-l line_count] [-p pattern] [file [prefix]]\n");
+"usage: split [-b byte_count | -l line_count | -p pattern] [filename [prefix]]\n");
 	exit(EX_USAGE);
 }
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3hzo3hwxrx.o3h>