GNU bug report logs - #16061
Error in the message for src/shuf.c:73 in 8.22-pre3

Previous Next

Package: coreutils;

Reported by: Philipp Thomas <pth <at> suse.de>

Date: Thu, 5 Dec 2013 20:55:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 16061 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: Philipp Thomas <pth <at> suse.de>, Assaf Gordon <assafgordon <at> gmail.com>,
 16061 <at> debbugs.gnu.org
Subject: Re: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3
Date: Fri, 06 Dec 2013 02:36:12 +0100
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




This bug report was last modified 11 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.