From owner-freebsd-doc Sun Jan 13 17: 0:22 2002 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A497637B41F for ; Sun, 13 Jan 2002 17:00:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0E104P25614; Sun, 13 Jan 2002 17:00:04 -0800 (PST) (envelope-from gnats) Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id A649437B41D for ; Sun, 13 Jan 2002 16:59:03 -0800 (PST) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id 5F220BD30 for ; Sun, 13 Jan 2002 16:59:03 -0800 (PST) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id QAA27267 for ; Sun, 13 Jan 2002 16:59:02 -0800 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id g0E11se03961; Sun, 13 Jan 2002 17:01:54 -0800 (PST) (envelope-from swear@blarg.net) Message-Id: <3hzo3hwxrx.o3h@localhost.localdomain> Date: 13 Jan 2002 17:01:54 -0800 From: "Gary W. Swearingen" Reply-To: swear@blarg.net To: FreeBSD-gnats-submit@freebsd.org Subject: docs/33852: split(1) man page implies that input file is removed. Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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