coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enhancement Requests: Add a seed value option to sort and shuf


From: Thomas Müller
Subject: Re: Enhancement Requests: Add a seed value option to sort and shuf
Date: Thu, 21 Nov 2013 14:29:31 +0100

Hi Eric,

thanks for the quick response. While the behavior I want can be
simulated using --random-source it is not exactly the same.
The main limitation of --random-source is that all the needed random
numbers have to be provided (see below).
Couldn't the behavior be changed to continue with IAAS when then end
of the random source is reached?

Best,
Thomas

$ echo 4 > seed_file
$ echo '1 2 3' | tr ' ' '\n' | sort -R --random-source=seed_file
sort: seed_file: end of file
$ echo '1 2 3 4 5 6 7 8 9 10 11' | tr ' ' '\n' | shuf --random-source=seed_file
shuf: seed_file: end of file

On Wed, Nov 20, 2013 at 7:03 PM, Eric Blake <address@hidden> wrote:
> On 11/20/2013 10:29 AM, Thomas Müller wrote:
>> Hi,
>>
>> I would appreciate if sort (and shuf) had an option to specify a seed
>> value that could be set during random sort in order to always get the
>> same permutation of an input file.
>
> Already present.  See sort --random-source=/path/to/file where
> /path/to/file contains the seed.  Similarly for shuf
> --random-source=/path/to/file.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]