From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Philipp Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 05 Dec 2013 20:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 16061@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138627687326833 (code B ref -1); Thu, 05 Dec 2013 20:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Dec 2013 20:54:33 +0000 Received: from localhost ([127.0.0.1]:60485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VofwO-0006yj-On for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50218) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VofwN-0006yb-75 for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VofwD-0007NO-Jx for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:30 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VofwD-0007NK-Gx for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vofw5-0004mv-S2 for bug-coreutils@gnu.org; Thu, 05 Dec 2013 15:54:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vofvy-0007Lg-JF for bug-coreutils@gnu.org; Thu, 05 Dec 2013 15:54:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51342 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vofvy-0007Lb-Cq for bug-coreutils@gnu.org; Thu, 05 Dec 2013 15:54:06 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1F70DA7D46 for ; Thu, 5 Dec 2013 21:54:04 +0100 (CET) Date: Thu, 5 Dec 2013 21:54:04 +0100 From: Philipp Thomas Message-ID: <20131205205404.GD6406@paradies.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: openSUSE - Kernel Linux 3.11.6-5-desktop x86_64 Organization: SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix =?UTF-8?Q?Imend=C3=B6rffer,?= HRB 21284 (AG =?UTF-8?Q?N=C3=BCrnberg?=) User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The description for the -r option for shuf in 8.22-pre3 reads: " -r, --repetitions output COUNT items, allowing repetition.\n" " -n 1 is implied if not specified.\n" Which is confusing as to what COUNT relates to. Philipp From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 05 Dec 2013 23:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Philipp Thomas Cc: 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138628669618948 (code B ref 16061); Thu, 05 Dec 2013 23:39:01 +0000 Received: (at 16061) by debbugs.gnu.org; 5 Dec 2013 23:38:16 +0000 Received: from localhost ([127.0.0.1]:60732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoiUp-0004vX-EN for submit@debbugs.gnu.org; Thu, 05 Dec 2013 18:38:15 -0500 Received: from mail1.vodafone.ie ([213.233.128.43]:3551) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoiUk-0004vJ-GY for 16061@debbugs.gnu.org; Thu, 05 Dec 2013 18:38:11 -0500 Received: from unknown (HELO [192.168.1.79]) ([109.76.218.118]) by mail1.vodafone.ie with ESMTP; 05 Dec 2013 23:38:09 +0000 Message-ID: <52A10E57.9070001@draigBrady.com> Date: Thu, 05 Dec 2013 23:37:59 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> In-Reply-To: <20131205205404.GD6406@paradies.suse.de> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 12/05/2013 08:54 PM, Philipp Thomas wrote: > The description for the -r option for shuf in 8.22-pre3 reads: > > " -r, --repetitions output COUNT items, allowing repetition.\n" > " -n 1 is implied if not specified.\n" > > Which is confusing as to what COUNT relates to. Yes this could be clearer. So the point is that --repetitions only makes sense in the context of a specified --head-count. How about: diff --git a/doc/coreutils.texi b/doc/coreutils.texi index c818a1e..5d49fef 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4923,7 +4923,7 @@ operation modes: @table @samp -@item -n @var{lines} +@item -n @var{count} @itemx --head-count=@var{count} @opindex -n @opindex --head-count diff --git a/src/shuf.c b/src/shuf.c index f7fc936..4d0ae90 100644 --- a/src/shuf.c +++ b/src/shuf.c @@ -76,8 +76,8 @@ Write a random permutation of the input lines to standard output.\n\ -n, --head-count=COUNT output at most COUNT lines\n\ -o, --output=FILE write result to FILE instead of standard output\n\ --random-source=FILE get random bytes from FILE\n\ - -r, --repetitions output COUNT items, allowing repetition.\n\ - -n 1 is implied if not specified.\n\ + -r, --repetitions allow repetition within a specified --head-count\n\ + which is assumed to be 1, if not specified.\n\ -z, --zero-terminated end lines with 0 byte, not newline\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 00:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Philipp Thomas , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138628895722447 (code B ref 16061); Fri, 06 Dec 2013 00:16:01 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 00:15:57 +0000 Received: from localhost ([127.0.0.1]:60782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Voj5I-0005pz-7X for submit@debbugs.gnu.org; Thu, 05 Dec 2013 19:15:56 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:50359) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Voj5F-0005pp-Oy for 16061@debbugs.gnu.org; Thu, 05 Dec 2013 19:15:54 -0500 Received: from [192.168.1.11] (p5499C1A7.dip0.t-ipconnect.de [84.153.193.167]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0M9RFK-1VjoSb1stC-00CPwR; Fri, 06 Dec 2013 01:15:47 +0100 Message-ID: <52A11732.3060201@bernhard-voelker.de> Date: Fri, 06 Dec 2013 01:15:46 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> In-Reply-To: <52A10E57.9070001@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:UIVXoepCWLTsufHE6dhIR6Er1BHUNz5/yHaOFOyPWqy 3sbykMRCn3f7j+yWMxzcucyxrZWTA6/EKLAbrSNbGmrQsZ+Ikf KReA/NxfG9VjuKX4r5SVEDPoUKllmwf9Q2M+lPAhPD8NAKWlGc zZTquItYjyqUC9fP/bo8iqb0hRL3Nfvxh3DkmFlfACFxga7/7h kC/AAhQZY/GUXClPabKEG5fBvwJ35Rg8bLUk7xALxwoqSObqMW k2sKZZfAu0nGg/urxtH5ezlF6jvRtuv2KpKZ5vHY/NvJsujy+S SXssMnLeGDri9RvCjTc9NDgDPk2vzMILjL6QcZiog/I1LpI69j pUajF8cgwFBUixrpUTlh6XGSflTwvYtC7qH7+E2l8 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/06/2013 12:37 AM, Pádraig Brady wrote: > diff --git a/src/shuf.c b/src/shuf.c > index f7fc936..4d0ae90 100644 > --- a/src/shuf.c > +++ b/src/shuf.c > @@ -76,8 +76,8 @@ Write a random permutation of the input lines to standard output.\n\ > -n, --head-count=COUNT output at most COUNT lines\n\ > -o, --output=FILE write result to FILE instead of standard output\n\ > --random-source=FILE get random bytes from FILE\n\ > - -r, --repetitions output COUNT items, allowing repetition.\n\ > - -n 1 is implied if not specified.\n\ > + -r, --repetitions allow repetition within a specified --head-count\n\ > + which is assumed to be 1, if not specified.\n\ n=1 is not really a repetition. ;-) BTW: What was the reason to default n=1 with -r anyway? I mean as the user did not specify any limit he may assume the same number as in the input, like without -r. Besides that, I can't think of a better wording than above. Have a nice day, Berny From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 01:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker Cc: Philipp Thomas , Assaf Gordon , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138629243127852 (code B ref 16061); Fri, 06 Dec 2013 01:14:02 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 01:13:51 +0000 Received: from localhost ([127.0.0.1]:60835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VojzL-0007F9-2B for submit@debbugs.gnu.org; Thu, 05 Dec 2013 20:13:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12198) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VojzI-0007Ey-5H for 16061@debbugs.gnu.org; Thu, 05 Dec 2013 20:13:49 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB61DhRS022430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Dec 2013 20:13:43 -0500 Received: from [10.36.116.18] (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB61Ddel020771 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 5 Dec 2013 20:13:41 -0500 Message-ID: <52A124C2.6010802@draigBrady.com> Date: Fri, 06 Dec 2013 01:13:38 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> In-Reply-To: <52A11732.3060201@bernhard-voelker.de> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 12/06/2013 12:15 AM, Bernhard Voelker wrote: > On 12/06/2013 12:37 AM, Pádraig Brady wrote: >> diff --git a/src/shuf.c b/src/shuf.c >> index f7fc936..4d0ae90 100644 >> --- a/src/shuf.c >> +++ b/src/shuf.c >> @@ -76,8 +76,8 @@ Write a random permutation of the input lines to standard output.\n\ >> -n, --head-count=COUNT output at most COUNT lines\n\ >> -o, --output=FILE write result to FILE instead of standard output\n\ >> --random-source=FILE get random bytes from FILE\n\ >> - -r, --repetitions output COUNT items, allowing repetition.\n\ >> - -n 1 is implied if not specified.\n\ >> + -r, --repetitions allow repetition within a specified --head-count\n\ >> + which is assumed to be 1, if not specified.\n\ > > n=1 is not really a repetition. ;-) > > BTW: What was the reason to default n=1 with -r anyway? > I mean as the user did not specify any limit he may assume > the same number as in the input, like without -r. Well --repetitions means --allow-repetitions and in this mode we're just picking random items from the input. So it doesn't make much sense then to output the same number of items as was input in this mode. It makes more sense to default to picking a single random item. Now granted that is a bit of an awkward default in the context of the --repetitions name. Though you could read `gen_data | shuf -r` as pick a random item from the data, which is less awkward. I suppose we could make -r require that -n is specified, but I'm not sure. Other edge cases I've now noticed... -n1 could degenerate to the faster --repetitions mode in all cases -n0 -r should exit without reading input These edge case fixes are not worth adding to this release though. thanks, Pádraig. From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 01:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Philipp Thomas , Assaf Gordon , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138629321129084 (code B ref 16061); Fri, 06 Dec 2013 01:27:01 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 01:26:51 +0000 Received: from localhost ([127.0.0.1]:60846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VokBu-0007Z1-19 for submit@debbugs.gnu.org; Thu, 05 Dec 2013 20:26:50 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:56409) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VokBq-0007Yq-CV for 16061@debbugs.gnu.org; Thu, 05 Dec 2013 20:26:47 -0500 Received: from [192.168.1.11] (p5499C1A7.dip0.t-ipconnect.de [84.153.193.167]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LrUvB-1VRXqg3kcP-013hD2; Fri, 06 Dec 2013 02:26:44 +0100 Message-ID: <52A127D3.4010908@bernhard-voelker.de> Date: Fri, 06 Dec 2013 02:26:43 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A124C2.6010802@draigBrady.com> In-Reply-To: <52A124C2.6010802@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:tltNW/spEtzVMwBvzGuYbA/ngCHqwI7210co1zgq9tz uwriDE/EcAE10sJrZPJTz/ROiho9ucnKuLe/b99+uhZypRy5mp kbAuKokbBvCgDvbk5xEioHsjkwCGO8++sqwuEl6Id2dyIxek+j oofxWtbn+hjRrHkVZzbMNAvwqnm7ac7ivjdqMhph2dDgBXWyms nHTtMq3FCc7XDY03c5BseoDaFbg3HFIvQCQ+WT1IWxSpKbyPEV JPbRsIHdncQ3n1+e2rdYz+BQHGjWn+GdewukzQejOgyeb2S07/ r4QtVt1vhLB8kbfpmlvf1qsn++G11xHQhycAAelWHQHyFbIzFy dZ9QByVDuZmyKBOhdb/FDQpjXEXqjdxY4rwtXDhKf X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/06/2013 02:13 AM, Pádraig Brady wrote: > On 12/06/2013 12:15 AM, Bernhard Voelker wrote: >> On 12/06/2013 12:37 AM, Pádraig Brady wrote: >>> diff --git a/src/shuf.c b/src/shuf.c >>> index f7fc936..4d0ae90 100644 >>> --- a/src/shuf.c >>> +++ b/src/shuf.c >>> @@ -76,8 +76,8 @@ Write a random permutation of the input lines to standard output.\n\ >>> -n, --head-count=COUNT output at most COUNT lines\n\ >>> -o, --output=FILE write result to FILE instead of standard output\n\ >>> --random-source=FILE get random bytes from FILE\n\ >>> - -r, --repetitions output COUNT items, allowing repetition.\n\ >>> - -n 1 is implied if not specified.\n\ >>> + -r, --repetitions allow repetition within a specified --head-count\n\ >>> + which is assumed to be 1, if not specified.\n\ >> >> n=1 is not really a repetition. ;-) >> >> BTW: What was the reason to default n=1 with -r anyway? >> I mean as the user did not specify any limit he may assume >> the same number as in the input, like without -r. > > Well --repetitions means --allow-repetitions and in this mode > we're just picking random items from the input. > So it doesn't make much sense then to output the same number > of items as was input in this mode. It makes more sense to > default to picking a single random item. Now granted that is > a bit of an awkward default in the context of the --repetitions name. > Though you could read `gen_data | shuf -r` as pick a > random item from the data, which is less awkward. Thanks, with this explanation, this default makes sense, agreed. > I suppose we could make -r require that -n is specified, > but I'm not sure. Regarding this in the above context - no, because then you would have to specify -n1 when "picking 1 random item". Saving the user from typing -n1 seems to be _the_ reason for assuming n=1. > Other edge cases I've now noticed... > > -n1 could degenerate to the faster --repetitions mode in all cases > -n0 -r should exit without reading input > > These edge case fixes are not worth adding to this release though. Agreed. Thanks & have a nice day, Berny From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 01:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Philipp Thomas , Assaf Gordon , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138629377830025 (code B ref 16061); Fri, 06 Dec 2013 01:37:01 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 01:36:18 +0000 Received: from localhost ([127.0.0.1]:60861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VokL3-0007oD-67 for submit@debbugs.gnu.org; Thu, 05 Dec 2013 20:36:17 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:65038) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VokL1-0007o2-8t for 16061@debbugs.gnu.org; Thu, 05 Dec 2013 20:36:15 -0500 Received: from [192.168.1.11] (p5499C1A7.dip0.t-ipconnect.de [84.153.193.167]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Ll1ub-1VGW762jaf-00azaV; Fri, 06 Dec 2013 02:36:13 +0100 Message-ID: <52A12A0C.2000204@bernhard-voelker.de> Date: Fri, 06 Dec 2013 02:36:12 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A124C2.6010802@draigBrady.com> <52A127D3.4010908@bernhard-voelker.de> In-Reply-To: <52A127D3.4010908@bernhard-voelker.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:QVMtlaoIXGjo2sPs8NY77RJIYnRMEKQ0hkVJaMpqNMq E7Nrb1F0GTD2IFjtlOq2PhSmPUgCstBMFhxCDxrgOD3rdHgAQB GKqboyonEEzJPq/HrS51KDDU2FWQX1bz/PeQmqfCbeYGbYMrkl VVqTaMtXIiKXH3CxUfmsVfY+DW5hIVyg+i8CqrHX2TShiYzOJB e9PCStlzgWV4AnyWNuTC2zzBzHP5VSAclzo66dTJIMvZhW2gRB Tn6mvqCL09A0C1vQ11iGC5z9FQU9g/99aXoqQIEEiy1YQJBamq ki2TUpTrbddP+i2R/UTphJZ8BQAQZ/oPMs11mEA+epmh/A+YLk Oi/cK+Tg70EG3iW6sq/G+MVJz+8AB9sLF3soV5Vum X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/06/2013 02:26 AM, Bernhard Voelker wrote: > On 12/06/2013 02:13 AM, Pádraig Brady wrote: >> I suppose we could make -r require that -n is specified, >> but I'm not sure. > > Regarding this in the above context - no, because then you would > have to specify -n1 when "picking 1 random item". Saving the user > from typing -n1 seems to be _the_ reason for assuming n=1. OTOH there may be cases where you don't know the number of items beforehand, but you want shuf to output that number of random items from the input regardless of repetitions: $ gen_data | shuf -r Shuf will know the number of elements and may easily pick that number incl. repetitions. If you want to pick just one, you know it and it's easy to say -n1, but it's not that easy in the above case. Have a nice day, Berny From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 01:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker Cc: Philipp Thomas , Assaf Gordon , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138629433831051 (code B ref 16061); Fri, 06 Dec 2013 01:46:02 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 01:45:38 +0000 Received: from localhost ([127.0.0.1]:60873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VokU4-00084j-Ln for submit@debbugs.gnu.org; Thu, 05 Dec 2013 20:45:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4910) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VokU0-00084U-TG for 16061@debbugs.gnu.org; Thu, 05 Dec 2013 20:45:33 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB61jRoS017030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Dec 2013 20:45:27 -0500 Received: from [10.36.116.18] (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rB61jOK5008345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Dec 2013 20:45:26 -0500 Message-ID: <52A12C33.60206@draigBrady.com> Date: Fri, 06 Dec 2013 01:45:23 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A124C2.6010802@draigBrady.com> <52A127D3.4010908@bernhard-voelker.de> <52A12A0C.2000204@bernhard-voelker.de> In-Reply-To: <52A12A0C.2000204@bernhard-voelker.de> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 12/06/2013 01:36 AM, Bernhard Voelker wrote: > On 12/06/2013 02:26 AM, Bernhard Voelker wrote: >> On 12/06/2013 02:13 AM, Pádraig Brady wrote: >>> I suppose we could make -r require that -n is specified, >>> but I'm not sure. >> >> Regarding this in the above context - no, because then you would >> have to specify -n1 when "picking 1 random item". Saving the user >> from typing -n1 seems to be _the_ reason for assuming n=1. > > OTOH there may be cases where you don't know the number of items > beforehand, but you want shuf to output that number of random items > from the input regardless of repetitions: > > $ gen_data | shuf -r > > Shuf will know the number of elements and may easily pick that > number incl. repetitions. > > If you want to pick just one, you know it and it's easy to say -n1, > but it's not that easy in the above case. But with random selection would there ever be a link between input and output cardinality? I can't think of a case that there would be. Pádraig. From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 06:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Philipp Thomas , Assaf Gordon , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138631269828255 (code B ref 16061); Fri, 06 Dec 2013 06:52:01 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 06:51:38 +0000 Received: from localhost ([127.0.0.1]:32857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VopGD-0007Le-C2 for submit@debbugs.gnu.org; Fri, 06 Dec 2013 01:51:37 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:56137) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VopGA-0007LV-I3 for 16061@debbugs.gnu.org; Fri, 06 Dec 2013 01:51:35 -0500 Received: from [192.168.1.11] (p5499C1A7.dip0.t-ipconnect.de [84.153.193.167]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MWQME-1W4f0g0mVu-00Xqbs; Fri, 06 Dec 2013 07:51:32 +0100 Message-ID: <52A173F3.9090504@bernhard-voelker.de> Date: Fri, 06 Dec 2013 07:51:31 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A124C2.6010802@draigBrady.com> <52A127D3.4010908@bernhard-voelker.de> <52A12A0C.2000204@bernhard-voelker.de> <52A12C33.60206@draigBrady.com> In-Reply-To: <52A12C33.60206@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:r583aHsXd2K+hBfxOzgjTkPHt6HUHvPnR2TdHUPii8k Z0ygi05g8wzOB6AM6OZE70Nq+d/YKjS4ILdhIN3oGWPg2FgqMa LVpJQlZ8NxKtvfUrCHPWS9Sh22Npg3YQP86qLTJTFJ9Y3M5+Lg P8lxJIOGMTioRYdyCDuEtG9SkhO5+hysU+WUGabEPQKzZAOgFe f/RIFx969JLi4g4SYosI680NAyedVflMXGYpxhwq4RBjjJ2ITB B4KWdzQOqQA2n2BA0y1MY+NN9PEsYaYiy8oflY1mPfSqMYzmFU 6GtahWJiXc1GNFY2hd9cEvLeFCNoRTM0ikFo0+x8pUbyHJNm+R j6TEVNL84VMzb/nimtlPeC8LuirncBLmQ3/6x/qhl X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/06/2013 02:45 AM, Pádraig Brady wrote: > But with random selection would there ever be a link > between input and output cardinality? > I can't think of a case that there would be. +1 From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 17:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker , =?UTF-8?Q?P=C3=A1draig?= Brady Cc: Philipp Thomas , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.13863526615100 (code B ref 16061); Fri, 06 Dec 2013 17:58:02 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 17:57:41 +0000 Received: from localhost ([127.0.0.1]:34503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vozel-0001KA-G6 for submit@debbugs.gnu.org; Fri, 06 Dec 2013 12:57:40 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:48041) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vozeg-0001Jz-Uo for 16061@debbugs.gnu.org; Fri, 06 Dec 2013 12:57:37 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id B8AAD39E810A; Fri, 6 Dec 2013 09:57:33 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mvQPPRZfacvd; Fri, 6 Dec 2013 09:57:32 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6A81439E8106; Fri, 6 Dec 2013 09:57:32 -0800 (PST) Message-ID: <52A21009.10602@cs.ucla.edu> Date: Fri, 06 Dec 2013 09:57:29 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> In-Reply-To: <52A11732.3060201@bernhard-voelker.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) On 12/05/2013 04:15 PM, Bernhard Voelker wrote: > BTW: What was the reason to default n=1 with -r anyway? There is no reason, and I see that I should have reviewed the --repetition patch better. Let's change the default back to infinity, which is what it was before. And let's change --repetitions to --repeat. Here's a patch, which I've taken the liberty of pushing. >From dc96593f18ae3a3264aad437add74f081e770cfc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 6 Dec 2013 09:55:17 -0800 Subject: [PATCH] shuf: --repeat, not --repetitions; default --head-count is infinity Original problem reported by Philipp Thomas in . * NEWS: shuf --repeat, not shuf --repetitions. * doc/coreutils.texi (shuf invocation): * src/shuf.c (usage, long_opts, main): * tests/misc/shuf.sh: Likewise. Also, the default head-count is infinity. --- NEWS | 4 ++-- doc/coreutils.texi | 37 +++++++++++------------------- src/shuf.c | 67 ++++++++++++++++++++++++------------------------------ tests/misc/shuf.sh | 50 ++++++++++++++++++++-------------------- 4 files changed, 70 insertions(+), 88 deletions(-) diff --git a/NEWS b/NEWS index 529c54b..87fd27d 100644 --- a/NEWS +++ b/NEWS @@ -92,8 +92,8 @@ GNU coreutils NEWS -*- outline -*- shred accepts new parameters to the --remove option to give greater control over that operation, which can greatly reduce sync overhead. - shuf accepts a new option: --repetitions (-r), to allow repetitions - of input items in the permuted output. + shuf accepts a new option: --repeat (-r), which can repeat items in + the output. ** Changes in behavior diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 74d5025..ed311a1 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4948,14 +4948,16 @@ Use @var{file} as a source of random data used to determine which permutation to generate. @xref{Random sources}. @item -r -@itemx --repetitions +@itemx --repeat @opindex -r -@opindex --repetitions -@cindex allowing repetitions in output values -Changes the default behaviour of @command{shuf}, allowing repetition in -output values (in which case, @option{--head-count} can be larger -than the number of input values). If @option{--head-count} is not -specified, output a single random value. +@opindex --repeat +@cindex repeat output values +Repeat output values, that is, select with replacement. With this +option the output is not a permutation of the input; instead, each +output line is randomly chosen from all the inputs. This option is +typically combined with @option{--head-count}; if +@option{--head-count} is not given, @command{shuf} repeats +indefinitely. @zeroTerminatedOption @@ -5010,37 +5012,24 @@ and the command @samp{shuf -i 1-4} might output: @end example @noindent -These examples all have four input lines, so @command{shuf} might +The above examples all have four input lines, so @command{shuf} might produce any of the twenty-four possible permutations of the input. In general, if there are @var{n} input lines, there are @var{n}! (i.e., @var{n} factorial, or @var{n} * (@var{n} - 1) * @dots{} * 1) possible output permutations. @noindent -To output 50 random numbers between 0 and 9, use: +To output 50 random numbers each in the range 0 through 9, use: @example -shuf --repetitions --input-range 0-9 --head-count 50 -@end example - -@noindent -or (using short options): - -@example -shuf -r -i0-9 -n50 +shuf -r -n 50 -i 0-9 @end example @noindent To simulate 100 coin flips, use: @example -shuf -r -n100 -e Head Tail -@end example - -@noindent -or -@example -printf '%s\n' Head Tail | shuf -r -n100 +shuf -r -n 100 -e Head Tail @end example @exitstatus diff --git a/src/shuf.c b/src/shuf.c index f7fc936..456140f 100644 --- a/src/shuf.c +++ b/src/shuf.c @@ -76,8 +76,7 @@ Write a random permutation of the input lines to standard output.\n\ -n, --head-count=COUNT output at most COUNT lines\n\ -o, --output=FILE write result to FILE instead of standard output\n\ --random-source=FILE get random bytes from FILE\n\ - -r, --repetitions output COUNT items, allowing repetition.\n\ - -n 1 is implied if not specified.\n\ + -r, --repeat output lines can be repeated\n\ -z, --zero-terminated end lines with 0 byte, not newline\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -106,7 +105,7 @@ static struct option const long_opts[] = {"head-count", required_argument, NULL, 'n'}, {"output", required_argument, NULL, 'o'}, {"random-source", required_argument, NULL, RANDOM_SOURCE_OPTION}, - {"repetitions", no_argument, NULL, 'r'}, + {"repeat", no_argument, NULL, 'r'}, {"zero-terminated", no_argument, NULL, 'z'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -300,10 +299,10 @@ read_input (FILE *in, char eolbyte, char ***pline) return n_lines; } -/* output 'n_lines' to stdout from 'line' array, - chosen by the indices in 'permutation'. - 'permutation' and 'line' must have at least 'n_lines' elements. - strings in 'line' must include the line-terminator character. */ +/* Output N_LINES lines to stdout from LINE array, + chosen by the indices in PERMUTATION. + PERMUTATION and LINE must have at least N_LINES elements. + Strings in LINE must include the line-terminator character. */ static int write_permuted_lines (size_t n_lines, char *const *line, size_t const *permutation) @@ -321,8 +320,8 @@ write_permuted_lines (size_t n_lines, char *const *line, return 0; } -/* output 'n_lines' of numbers to stdout, from 'permutation' array. - 'permutation' must have at least 'n_lines' elements. */ +/* Output N_LINES of numbers to stdout, from PERMUTATION array. + PERMUTATION must have at least N_LINES elements. */ static int write_permuted_numbers (size_t n_lines, size_t lo_input, size_t const *permutation, char eolbyte) @@ -339,8 +338,8 @@ write_permuted_numbers (size_t n_lines, size_t lo_input, return 0; } -/* output 'count' numbers to stdout, chosen randomly from range - lo_input to hi_input. */ +/* Output COUNT numbers to stdout, chosen randomly from range + LO_INPUT through HI_INPUT. */ static int write_random_numbers (struct randint_source *s, size_t count, size_t lo_input, size_t hi_input, char eolbyte) @@ -358,9 +357,9 @@ write_random_numbers (struct randint_source *s, size_t count, return 0; } -/* output 'count' lines to stdout from 'lines' array. - 'lines' must have at least 'n_lines' element in it. - strings in 'line' must include the line-terminator character. */ +/* Output COUNT lines to stdout from LINES array. + LINES must have at least N_LINES elements in it. + Strings in LINES_ must include the line-terminator character. */ static int write_random_lines (struct randint_source *s, size_t count, char *const *lines, size_t n_lines) @@ -392,7 +391,7 @@ main (int argc, char **argv) char eolbyte = '\n'; char **input_lines = NULL; bool use_reservoir_sampling = false; - bool repetition = false; + bool repeat = false; int optc; int n_operands; @@ -479,7 +478,7 @@ main (int argc, char **argv) break; case 'r': - repetition = true; + repeat = true; break; case 'z': @@ -495,20 +494,19 @@ main (int argc, char **argv) n_operands = argc - optind; operand = argv + optind; - /* Check invalid usage */ + /* Check invalid usage. */ if (echo && input_range) { error (0, 0, _("cannot combine -e and -i options")); usage (EXIT_FAILURE); } - if ((n_operands>0 && input_range) - || (!echo && !input_range && n_operands>=2)) + if (input_range ? 0 < n_operands : !echo && 1 < n_operands) { error (0, 0, _("extra operand %s"), quote (operand[1])); usage (EXIT_FAILURE); } - /* Prepare input */ + /* Prepare input. */ if (echo) { input_from_argv (operand, n_operands, eolbyte); @@ -522,15 +520,15 @@ main (int argc, char **argv) } else { - /* Input file specified, re-open it as STDIN */ - if (n_operands==1) - if (! (STREQ (operand[0], "-") || ! head_lines - || freopen (operand[0], "r", stdin))) - error (EXIT_FAILURE, errno, "%s", operand[0]); + /* If an input file is specified, re-open it as stdin. */ + if (n_operands == 1) + if (! (STREQ (operand[0], "-") || ! head_lines + || freopen (operand[0], "r", stdin))) + error (EXIT_FAILURE, errno, "%s", operand[0]); fadvise (stdin, FADVISE_SEQUENTIAL); - if (! repetition && head_lines != SIZE_MAX + if (! repeat && head_lines != SIZE_MAX && (! head_lines || input_size () > RESERVOIR_MIN_INPUT)) { use_reservoir_sampling = true; @@ -543,18 +541,13 @@ main (int argc, char **argv) } } - /* When generating random numbers with repetitions, - the default count is one, unless specified by the user. */ - if (repetition && head_lines == SIZE_MAX) - head_lines = 1 ; - - if (! repetition) + if (! repeat) head_lines = MIN (head_lines, n_lines); randint_source = randint_all_new (random_source, - (use_reservoir_sampling || repetition)? - SIZE_MAX: - randperm_bound (head_lines, n_lines)); + (use_reservoir_sampling || repeat + ? SIZE_MAX + : randperm_bound (head_lines, n_lines))); if (! randint_source) error (EXIT_FAILURE, errno, "%s", quotearg_colon (random_source)); @@ -574,14 +567,14 @@ main (int argc, char **argv) && (fclose (stdin) != 0)) error (EXIT_FAILURE, errno, _("read error")); - if (!repetition) + if (!repeat) permutation = randperm_new (randint_source, head_lines, n_lines); if (outfile && ! freopen (outfile, "w", stdout)) error (EXIT_FAILURE, errno, "%s", quotearg_colon (outfile)); /* Generate output according to requested method */ - if (repetition) + if (repeat) { if (input_range) i = write_random_numbers (randint_source, head_lines, diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh index a25a6f8..28c6483 100755 --- a/tests/misc/shuf.sh +++ b/tests/misc/shuf.sh @@ -94,66 +94,66 @@ shuf -i0-9 -o A -o B && shuf -i0-9 --random-source A --random-source B && { fail=1; echo "shuf did not detect multiple --random-source usage.">&2 ; } -# Test --repetition option +# Test --repeat option -# --repetition without count should return one line -shuf --rep -i0-10 > exp || framework_failure_ +# --repeat without count should return an indefinite number of lines +shuf --rep -i 0-10 | head -n 1000 > exp || framework_failure_ c=$(wc -l < exp) || framework_failure_ -test "$c" -eq 1 || { fail=1; echo "--repetition default count is not 1">&2 ; } +test "$c" -eq 1000 || { fail=1; echo "--repeat does not repeat indefinitely">&2 ; } -# --repetition can output more values than the input range +# --repeat can output more values than the input range shuf --rep -i0-9 -n1000 > exp || framework_failure_ c=$(wc -l < exp) || framework_failure_ -test "$c" -eq 1000 || { fail=1; echo "--repetition with --count failed">&2 ; } +test "$c" -eq 1000 || { fail=1; echo "--repeat with --count failed">&2 ; } # Check output values (this is not bullet-proof, but drawing 1000 values # between 0 and 9 should produce all values, unless there's a bug in shuf # or a very poor random source, or extremely bad luck) c=$(sort -nu exp | paste -s -d ' ') || framework_failure_ test "$c" = "0 1 2 3 4 5 6 7 8 9" || - { fail=1; echo "--repetition produced bad output">&2 ; } + { fail=1; echo "--repeat produced bad output">&2 ; } -# check --repetition with non-zero low value +# check --repeat with non-zero low value shuf --rep -i222-233 -n2000 > exp || framework_failure_ c=$(cat exp | sort -nu | paste -s -d ' ') || framework_failure_ test "$c" = "222 223 224 225 226 227 228 229 230 231 232 233" || - { fail=1; echo "--repetition produced bad output with non-zero low">&2 ; } + { fail=1; echo "--repeat produced bad output with non-zero low">&2 ; } -# --repetition,-i,count=0 should not fail and produce no output +# --repeat,-i,count=0 should not fail and produce no output shuf --rep -i0-9 -n0 > exp || framework_failure_ # file size should be zero (no output from shuf) test \! -s exp || - { fail=1; echo "--repetition,-i0-9,-n0 produced bad output">&2 ; } + { fail=1; echo "--repeat,-i0-9,-n0 produced bad output">&2 ; } -# --repetition with -e, without count, should return one line -shuf --rep -e A B C D > exp || framework_failure_ -c=$(cat exp | wc -l) || framework_failure_ -test "$c" -eq 1 || - { fail=1; echo "--repetition,-e default count is not 1">&2 ; } +# --repeat with -e, without count, should repeat indefinitely +shuf --rep -e A B C D | head -n 1000 > exp || framework_failure_ +c=$(wc -l < exp) || framework_failure_ +test "$c" -eq 1000 || + { fail=1; echo "--repeat,-e does not repeat indefinitely">&2 ; } -# --repetition with STDIN, without count, should return one line -printf "A\nB\nC\nD\nE\n" | shuf --rep > exp || framework_failure_ +# --repeat with STDIN, without count, should repeat indefinitely +printf "A\nB\nC\nD\nE\n" | shuf --rep | head -n 1000 > exp || framework_failure_ c=$(wc -l < exp) || framework_failure_ -test "$c" -eq 1 || - { fail=1; echo "--repetition,STDIN default count is not 1">&2 ; } +test "$c" -eq 1000 || + { fail=1; echo "--repeat,STDIN does not repeat indefinitely">&2 ; } -# --repetition with STDIN,count - can return move values than input lines +# --repeat with STDIN,count - can return move values than input lines printf "A\nB\nC\nD\nE\n" | shuf --rep -n2000 > exp || framework_failure_ c=$(wc -l < exp) || framework_failure_ test "$c" -eq 2000 || - { fail=1; echo "--repetition,STDIN,count failed">&2 ; } + { fail=1; echo "--repeat,STDIN,count failed">&2 ; } # Check output values (this is not bullet-proof, but drawing 2000 values # between A and E should produce all values, unless there's a bug in shuf # or a very poor random source, or extremely bad luck) c=$(sort -u exp | paste -s -d ' ') || framework_failure_ test "$c" = "A B C D E" || - { fail=1; echo "--repetition,STDIN,count produced bad output">&2 ; } + { fail=1; echo "--repeat,STDIN,count produced bad output">&2 ; } -# --repetition,stdin,count=0 should not fail and produce no output +# --repeat,stdin,count=0 should not fail and produce no output printf "A\nB\nC\nD\nE\n" | shuf --rep -n0 > exp || framework_failure_ # file size should be zero (no output from shuf) test \! -s exp || - { fail=1; echo "--repetition,STDIN,-n0 produced bad output">&2 ; } + { fail=1; echo "--repeat,STDIN,-n0 produced bad output">&2 ; } Exit $fail -- 1.8.3.1 From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: Philipp Thomas , Bernhard Voelker , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138635591610649 (code B ref 16061); Fri, 06 Dec 2013 18:52:01 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 18:51:56 +0000 Received: from localhost ([127.0.0.1]:34593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp0VI-0002lf-AK for submit@debbugs.gnu.org; Fri, 06 Dec 2013 13:51:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29127) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp0VG-0002lV-C7 for 16061@debbugs.gnu.org; Fri, 06 Dec 2013 13:51:55 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB6Iph0Z023409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Dec 2013 13:51:43 -0500 Received: from [10.36.116.91] (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB6IpepT002944 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 6 Dec 2013 13:51:41 -0500 Message-ID: <52A21CBB.10905@draigBrady.com> Date: Fri, 06 Dec 2013 18:51:39 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A21009.10602@cs.ucla.edu> In-Reply-To: <52A21009.10602@cs.ucla.edu> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 12/06/2013 05:57 PM, Paul Eggert wrote: > On 12/05/2013 04:15 PM, Bernhard Voelker wrote: >> BTW: What was the reason to default n=1 with -r anyway? > > There is no reason, and I see that I should have reviewed the --repetition > patch better. Let's change the default back to infinity, which > is what it was before. And let's change --repetitions to --repeat. > Here's a patch, which I've taken the liberty of pushing. Not great timing, but I do agree with the change. It all looks good. thanks, Pádraig. From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: Philipp Thomas , =?UTF-8?Q?P=C3=A1draig?= Brady , 16061@debbugs.gnu.org Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138635800314113 (code B ref 16061); Fri, 06 Dec 2013 19:27:01 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 19:26:43 +0000 Received: from localhost ([127.0.0.1]:34685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp12v-0003fX-Rf for submit@debbugs.gnu.org; Fri, 06 Dec 2013 14:26:42 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:50778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp12s-0003fO-Ja for 16061@debbugs.gnu.org; Fri, 06 Dec 2013 14:26:39 -0500 Received: from [192.168.1.11] (p5499C1A7.dip0.t-ipconnect.de [84.153.193.167]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0Mb5Ch-1W8cUa21UJ-00KrRC; Fri, 06 Dec 2013 20:26:35 +0100 Message-ID: <52A224EA.8020209@bernhard-voelker.de> Date: Fri, 06 Dec 2013 20:26:34 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A21009.10602@cs.ucla.edu> In-Reply-To: <52A21009.10602@cs.ucla.edu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:7xa9bGAGp8neyiG9lUupcnsSX/iiAVm9K3e10dRTGMw 3rNUMAMdBLHoPHOPBA+g2tbMhrXkqF9gJn+LZZ3m6Ex9abvOR6 I7CoqUK/IqgqzxrG3okBnT7bC+bWue1QhRemmo6oLa+cpkhQ62 7MUOJlUuHGvgezrPzuOriLXP1CMV2y6SBSQvHuuQBgcrjAvo9Y jLlhXkaZoQ9YC+mdR8QpnKK28bRXCfpFyix7/HzpextismIRqP 1CxIrkor179odWQ0ve6yGJKMmBKD83cvODDrXaqLub0eI5QKEQ tM5ux+G087Ji2uv8zoYOzGX8a7qW5f3izYP8B0mPKrMBBeo3DN upHAfNLFrdP4kmavPx30XxabrT7ePvyN9wt5Y+Yly X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/06/2013 06:57 PM, Paul Eggert wrote: > Here's a patch, which I've taken the liberty of pushing. Thanks, I'm fine with this behavior. Minor nit: sc_long_lines is triggered. BTW: I noticed another tiny flaw in the test (not related to your patch). The following fixes both. Have a nice day, Berny >From b4f5dca24f3ca2eea6060cff9695d746c125747b Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Fri, 6 Dec 2013 20:24:38 +0100 Subject: [PATCH] tests: fix shuf test verifying that -i and -e can not be combined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the test triggered another error diagnostic: shuf: invalid input range ‘-e’ and therefore eclipsed the expected one: shuf: cannot combine -e and -i options While at it, reindent a line with more than 80 characters, present since the previous commit to silence sc_long_lines. * tests/misc/shuf.sh: Pass a valid range to the -i option. --- tests/misc/shuf.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh index 28c6483..b2cd1ab 100755 --- a/tests/misc/shuf.sh +++ b/tests/misc/shuf.sh @@ -73,7 +73,7 @@ test "$c" -eq 3 || { fail=1; echo "Multiple -n failed">&2 ; } # Test error conditions # -i and -e must not be used together -: | shuf -i -e A B && +: | shuf -i0-9 -e A B && { fail=1; echo "shuf did not detect erroneous -e and -i usage.">&2 ; } # Test invalid value for -n : | shuf -nA && @@ -99,7 +99,8 @@ shuf -i0-9 --random-source A --random-source B && # --repeat without count should return an indefinite number of lines shuf --rep -i 0-10 | head -n 1000 > exp || framework_failure_ c=$(wc -l < exp) || framework_failure_ -test "$c" -eq 1000 || { fail=1; echo "--repeat does not repeat indefinitely">&2 ; } +test "$c" -eq 1000 \ + || { fail=1; echo "--repeat does not repeat indefinitely">&2 ; } # --repeat can output more values than the input range shuf --rep -i0-9 -n1000 > exp || framework_failure_ -- 1.8.3.1 From unknown Thu Jun 19 14:30:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philipp Thomas Subject: bug#16061: closed (Re: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3) Message-ID: References: <52A22F0F.8010209@draigBrady.com> <20131205205404.GD6406@paradies.suse.de> X-Gnu-PR-Message: they-closed 16061 X-Gnu-PR-Package: coreutils Reply-To: 16061@debbugs.gnu.org Date: Fri, 06 Dec 2013 20:11:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1386360663-18475-1" This is a multi-part message in MIME format... ------------=_1386360663-18475-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #16061: Error in the message for src/shuf.c:73 in 8.22-pre3 which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 16061@debbugs.gnu.org. --=20 16061: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D16061 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1386360663-18475-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 16061-done) by debbugs.gnu.org; 6 Dec 2013 20:10:02 +0000 Received: from localhost ([127.0.0.1]:34733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp1ir-0004ls-GU for submit@debbugs.gnu.org; Fri, 06 Dec 2013 15:10:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4062) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp1ip-0004lc-EM for 16061-done@debbugs.gnu.org; Fri, 06 Dec 2013 15:10:00 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB6K9tAN029897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Dec 2013 15:09:55 -0500 Received: from [10.36.116.17] (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB6K9qQR023488 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 6 Dec 2013 15:09:53 -0500 Message-ID: <52A22F0F.8010209@draigBrady.com> Date: Fri, 06 Dec 2013 20:09:51 +0000 From: =?windows-1252?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Bernhard Voelker Subject: Re: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A21009.10602@cs.ucla.edu> <52A224EA.8020209@bernhard-voelker.de> In-Reply-To: <52A224EA.8020209@bernhard-voelker.de> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 16061-done Cc: Philipp Thomas , 16061-done@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 12/06/2013 07:26 PM, Bernhard Voelker wrote: > On 12/06/2013 06:57 PM, Paul Eggert wrote: >> Here's a patch, which I've taken the liberty of pushing. > > Thanks, I'm fine with this behavior. > Minor nit: sc_long_lines is triggered. > > BTW: I noticed another tiny flaw in the test (not related to > your patch). The following fixes both. good spot! Please push. Marking this bug as done. thanks everyone, Pádraig. ------------=_1386360663-18475-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Dec 2013 20:54:33 +0000 Received: from localhost ([127.0.0.1]:60485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VofwO-0006yj-On for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50218) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VofwN-0006yb-75 for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VofwD-0007NO-Jx for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:30 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VofwD-0007NK-Gx for submit@debbugs.gnu.org; Thu, 05 Dec 2013 15:54:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vofw5-0004mv-S2 for bug-coreutils@gnu.org; Thu, 05 Dec 2013 15:54:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vofvy-0007Lg-JF for bug-coreutils@gnu.org; Thu, 05 Dec 2013 15:54:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51342 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vofvy-0007Lb-Cq for bug-coreutils@gnu.org; Thu, 05 Dec 2013 15:54:06 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1F70DA7D46 for ; Thu, 5 Dec 2013 21:54:04 +0100 (CET) Date: Thu, 5 Dec 2013 21:54:04 +0100 From: Philipp Thomas To: bug-coreutils@gnu.org Subject: Error in the message for src/shuf.c:73 in 8.22-pre3 Message-ID: <20131205205404.GD6406@paradies.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: openSUSE - Kernel Linux 3.11.6-5-desktop x86_64 Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?= =?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?= =?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?= User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The description for the -r option for shuf in 8.22-pre3 reads: " -r, --repetitions output COUNT items, allowing repetition.\n" " -n 1 is implied if not specified.\n" Which is confusing as to what COUNT relates to. Philipp ------------=_1386360663-18475-1-- From unknown Thu Jun 19 14:30:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3 Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 06 Dec 2013 20:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16061 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 16061@debbugs.gnu.org, P@draigBrady.com, pth@suse.de Received: via spool by 16061-submit@debbugs.gnu.org id=B16061.138636308931073 (code B ref 16061); Fri, 06 Dec 2013 20:52:02 +0000 Received: (at 16061) by debbugs.gnu.org; 6 Dec 2013 20:51:29 +0000 Received: from localhost ([127.0.0.1]:34834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp2My-000856-CN for submit@debbugs.gnu.org; Fri, 06 Dec 2013 15:51:28 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:58510) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp2Mv-00084w-HV for 16061@debbugs.gnu.org; Fri, 06 Dec 2013 15:51:26 -0500 Received: from [192.168.1.11] (p5499C1A7.dip0.t-ipconnect.de [84.153.193.167]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MZV1R-1WAHB30EbV-00L18S; Fri, 06 Dec 2013 21:51:24 +0100 Message-ID: <52A238CA.7070301@bernhard-voelker.de> Date: Fri, 06 Dec 2013 21:51:22 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 References: <20131205205404.GD6406@paradies.suse.de> <52A10E57.9070001@draigBrady.com> <52A11732.3060201@bernhard-voelker.de> <52A21009.10602@cs.ucla.edu> <52A224EA.8020209@bernhard-voelker.de> <52A22F0F.8010209@draigBrady.com> In-Reply-To: <52A22F0F.8010209@draigBrady.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:TY++B8lPOhsMt6z/HNWJuLkbomWC1Hw3AHu63YYG9eM yl0Za4MuCP41N4ZIKQV8ozd9nU6DOXjr0oifMIcK3NwypRj3lg QkL3f9+qp+5ReqTGxzml+AC0MkjcJGigzo/swgy3GkNxN4+G2z H4LMW+saIiBXGC1LSR2zPl0LYDqvKtAyuIzQMUOj/N9Jz42UVQ WbnCcjboaLdZEB1k2TXgmFdBIbLRu5dV7YMr1rLf9S0BgoMxyn +Nho3kyqNft5VJLe3vXLdqd4FAVQbx5EayFNvyCLlGqFEjVNfN D3Z6j5uTW0zGZSltj688Pa30rrxRsE5KD/ie32aAsSCHdci3vk 4uSVpBjYlap0kcrF2aXvLoVfQ9EKwRFcqKeMeE3ax X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/06/2013 09:09 PM, Pádraig Brady wrote: > On 12/06/2013 07:26 PM, Bernhard Voelker wrote: >> BTW: I noticed another tiny flaw in the test (not related to >> your patch). The following fixes both. > > good spot! > > Please push. Thanks, done: v8.21-179-gb4f5dca Have a nice day, Berny