bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3
From:
PƔdraig Brady
Subject:
bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3
Date:
Fri, 06 Dec 2013 01:45:23 +0000
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
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.