bug-coreutils
[Top][All Lists]
Advanced

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

Re: new coreutil? shuffle - randomize file contents


From: James Youngman
Subject: Re: new coreutil? shuffle - randomize file contents
Date: Thu, 2 Jun 2005 08:44:02 +0100
User-agent: Mutt/1.3.28i

On Wed, Jun 01, 2005 at 06:52:08PM -0700, Frederik Eaton wrote:
> So, what is the current state of things? Who is in charge of accepting
> patches? 

The coreutils maintainers, who are all subscribed to this list I
think.  So, you're asking in the right place.

> Are we decided that a 'shuffle' command but no 'sort -R' facility
> would be best

I think the consensus is that the functionality belongs in "sort".
Beyond that things are a bit less clear.  However, Paul put forward a
proposed usage which adapts the current -k option (see
http://lists.gnu.org/archive/html/bug-coreutils/2005-05/msg00179.html).
Nobody made any comments suggesting that that wasn't a good way of
doing things.

> or that it would be good to have both, or is it still in question
> whether either would be accepted?

Both is probably uncalled for though I personally would put something
like this in /usr/local/bin/shuffle:

#! /bin/sh
exec sort -k R -- "$@"

Having said this, in the past people have expressed the sentiment that
perhaps a separate command would be a good idea (for example
http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00007.html).

Last time this was discussed on this list there was some talk about
selecting permutations with a seed.  This makes me uncomfortable since
though doubtless it would be convenient.  The problem is that the
number of permutations of the records of most files is larger than
2^64, and so representing the seed and making use of it would be very
tricky.  I then had a look at Fascicle 2 of volume 4 of Knuth, but it
concentrates on generating all permutations, and so wasn't directly
much help.

Regards,
James.




reply via email to

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