bug-coreutils
[Top][All Lists]
Advanced

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

Re: Feature-Request: random sort


From: Brian Dessent
Subject: Re: Feature-Request: random sort
Date: Wed, 15 Nov 2006 19:00:56 -0800

Matthias Schniedermeyer wrote:

> As far as i can see it the opposite of sort is missing.
> Randomize/shuffling the incoming data lines, so you can e.x. use it for
> a playlist.
> 
> find . -type f | sort --shuffle | xargs <...>

You must not be using the current version.  This was added in 6.1:

`-R'
`--random-sort'
     Sort by hashing the input keys and then sorting the hash values.
     Choose the hash function at random, ensuring that it is free of
     collisions so that differing keys have differing hash values.
     This is like a random permutation of the inputs (*note shuf
     invocation::), except that keys with the same value sort together.

     If multiple random sort fields are specified, the same random hash
     function is used for all fields.  To use different random hash
     functions for different fields, you can invoke `sort' more than
     once.

     The choice of hash function is affected by the `--random-source'
     option.

Brian




reply via email to

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