> 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/