bug-coreutils
[Top][All Lists]
Advanced

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

Re: [wish] sort : what about randomization ?


From: Stepan Kasal
Subject: Re: [wish] sort : what about randomization ?
Date: Thu, 17 Jul 2003 16:28:43 +0200
User-agent: Mutt/1.2.5.1i

Hello,

On Thu, Jul 17, 2003 at 10:23:33AM +0200, Feth AREZKI wrote:
> I wish Sort would just accept a randomization option, so that I can organise 
> people names or playlists differently each time.

interesting idea.  We could have a new modifier, eg. ``-R'' or ``-u''
(unsorted) which could be given not only as global option, but also as 
a modifier for each key.

That way we could sort the file according to a key, but within each
group with the same key the order would be random...

I think, however, that this would be a bit weird behaviour and perhaps
we should not add this to the sort.  Programs with thousands of options
are difficult to use and difficult to maintain.

Let's wait for an answer from the maintainer of coreutiles, who is
responsible for sort.


For the time being, I can offer you an awk script which accomplishes
this.  randsort.awk needs a recent GNU awk, I think gawk-3.1.* is good,
perhaps gawk-3.* is enough.  (We need a version which has asort().)

randsort2.awk will run only with gawk-3.1.3 which is the last version
at the moment (and with any future version, of course).

(Both scripts are attached to this mail.)

Enjoy,
        Stepan

Attachment: randsort.awk
Description: Text document

Attachment: randsort2.awk
Description: Text document


reply via email to

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