GNU bug report logs - #33025
doc: sort: add examples for -R/--random sort

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Fri, 12 Oct 2018 16:29:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: 33025 <at> debbugs.gnu.org
Subject: bug#33025: Add examples of why one would want to "sort" something "randomly"
Date: Sat, 13 Oct 2018 00:28:32 +0800
On (info "(coreutils) sort invocation")

‘-R’
‘--random-sort’
‘--sort=random’
     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...

OK, but you need to mention some examples of why someone would want to
"sort" something "randomly".

OK, I have one:

You have a list of URLs.

You know there are probably duplicates in there, that you want to get
rid of.

But you also don't want to make it look like you have "machine sorted
them." You want them to still look "hand assembled."

So you use sort --random-sort --unique on them!




This bug report was last modified 6 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.