Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: shuffle array
- X-seq: zsh-workers 44966
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: shuffle array
- Date: Sun, 1 Dec 2019 19:57:56 +0000
- In-reply-to: <867e3jxtao.fsf__7557.99096530012$1574997710$gmane$org@zoho.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <867e3jxtao.fsf__7557.99096530012$1574997710$gmane$org@zoho.eu>
2019-11-29 04:20:15 +0100, Emanuel Berg:
> How do I shuffle an array?
>
> I found [1] but it seems like a lot of code?
> Not that that's a problem if that's the way
> it is.
[...]
You can do something like:
array=(/(Ne['reply=("$array[@]")']oe['REPLY=$RANDOM']))
Though that's a bit convoluted.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author