Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Sorting file names randomly
- X-seq: zsh-users 9142
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Sorting file names randomly
- Date: Sun, 24 Jul 2005 10:40:14 +0200
- In-reply-to: <20050724083732.GA73@DervishD>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
- References: <20050723194240.GA32416@DervishD> <20050723212657.GA744@DervishD> <1050724064415.ZM20425@xxxxxxxxxxxxxxxxxxxxxxx> <20050724083732.GA73@DervishD>
Hi :)
* DervishD <zsh@xxxxxxxxxxxx> dixit:
> How about this?:
>
> function shuffle () {
>
> emulate -L zsh
>
> setopt nullglob globdots rcexpandparam
>
> RANDOM=`date +%s`
> [[ $# -eq 0 ]] && set '*'
>
> reply=()
Of course this is not needed, I left it in place from a
modification I did to test.
> reply=($*)
> reply=($reply(e:'REPLY="${(l.5..0.)RANDOM} $REPLY"':))
> reply=(${(o)reply})
How could I avoid doing this? I cannot put the 'o' in the
assignment above this one because it doesn't work, it seems to sort
*before* applying the 'e' glob modifier).
> reply=(${reply/#????? /})
>
> print -l $reply
>
> return 0
> }
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author