Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: pretty easy thing but too hard for me! (random array element)
- X-seq: zsh-users 11696
- From: Geoff Wing <gcw@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: pretty easy thing but too hard for me! (random array element)
- Date: Thu, 2 Aug 2007 12:17:40 +1000
- In-reply-to: <20070802015226.GC32551@princo>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: PrimeNet Computer Consultancy
- References: <fb3648c60708011447o3100794esded1e427ce8dd32d@xxxxxxxxxxxxxx> <20070802015226.GC32551@princo>
On Thursday 2007-08-02 11:52 +1000, Jean-Rene David output:
:* fREW [2007.08.01 18:00]:
:> AWESOME! Now I can read a random dinosaur comic
:Would you mind sharing that awesome off-list reply
:with the rest of us?
See the randline function (distributed with zsh for over 15 years) for a hint.
Something like the following will do it.
FILES=( .../files/* )
feh $FILES[$RANDOM%$#FILES+1]
Regards,
Geoff
Messages sorted by:
Reverse Date,
Date,
Thread,
Author