bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] Makes sort create random order


From: Frederik Eaton
Subject: Re: [PATCH] Makes sort create random order
Date: Sun, 30 Jan 2005 11:58:17 -0800
User-agent: Mutt/1.5.6+20040907i

> Such a program could do things interesting like :-
> 
> 1. Permute pseudo-randomly by default.
> 2. Permute pseudo-randomly according to a seed specified on the
>    command line
> 3. Generate the Nth permutation of its input, according to a
>    reproducible scheme
> 4. Permute almost pseudo-randomly but with the proviso that the output
>    differ from the input - and of course will fail for inputs less
>    than two lines long.
> 5. Permute as directed by a stream of 'random' data (e.g. /dev/urandom
>    or /dev/zero or a saved file - not obvious whether to loop on EOF
>    or fail.)
> 
> These are all interesting ways to permute the lines of a file, but the
> number of options implied by the above suggestions would be
> inappropriate for "sort".

I encourage you to write such a program. (I'm not sure if option
numbers 4 or 5 would be very useful, though) Other ideas: require that
the permutation be a derangement, or have a minimum cycle length or
order.

However, none of your additional suggestions have much relevance to
the type of application being discussed; nor would they seem to be
able to share much of their implementation with the rest of the
infrastructure of the 'sort' command. Furthermore, the fact that a
feature could be extended to absurd lengths isn't a reason to hold off
implementing it in a reasonable form.

Frederik

-- 
----------------------------------------------------------------
Frederik Eaton                         http://ofb.net/~frederik/




reply via email to

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