From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: shuffle array
Date: Sun, 1 Dec 2019 19:57:56 +0000 [thread overview]
Message-ID: <20191201195756.2wbhs74nmiihanjs@chaz.gmail.com> (raw)
In-Reply-To: <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
next parent reply other threads:[~2019-12-01 20:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <867e3jxtao.fsf__7557.99096530012$1574997710$gmane$org@zoho.eu>
2019-12-01 19:57 ` Stephane Chazelas [this message]
[not found] <867e3jxtao.fsf@zoho.eu>
[not found] ` <20191129064215.GA14095@prometheus.u-strasbg.fr>
[not found] ` <8636e7w0w9.fsf__36104.0529723809$1575015640$gmane$org@zoho.eu>
[not found] ` <20191201200719.anzbs27c7phgdnmm@chaz.gmail.com>
[not found] ` <20191201233848.7selcpkvenlu65px__33142.5388505281$1575243619$gmane$org@tarpaulin.shahaf.local2>
[not found] ` <20191202141421.sj7nlhsdrpqxpr42@chaz.gmail.com>
[not found] ` <CAN=4vMpt+hQw2zxUC1LH+3bPymBX_5qqexFw-vqkN6ye+dG1ZQ__45487.0572009654$1575297047$gmane$org@mail.gmail.com>
2019-12-02 15:16 ` Stephane Chazelas
2019-12-02 15:27 ` Roman Perepelitsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191201195756.2wbhs74nmiihanjs@chaz.gmail.com \
--to=stephane.chazelas@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).