Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: random once but not twice
- X-seq: zsh-users 22965
- From: Emanuel Berg <moasen@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: random once but not twice
- Date: Sat, 11 Nov 2017 23:26:04 +0100
- Cancel-lock: sha1:QIm0MKMq4cDfvbZNRVThZvkbkE8=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mail-copies-to: never
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <86k1yw63u0.fsf@zoho.com> <CAHYJk3SE_JV0BHY55vjgqSeDeM5vTOB=d1UH_Ok-yn0WBZv4Zg@mail.gmail.com>
Mikael Magnusson wrote:
> The subshell in the second function ensures
> that the RANDOM state in the parent shell
> stays the same.
But why doesn't the next invocation produce
a new value? As in
random-test () {
repeat 10 echo $RANDOM
}
$ random-test
9235
18141
28176
10397
14564
21514
2335
31921
7989
8201
--
underground experts united
http://user.it.uu.se/~embe8573
Messages sorted by:
Reverse Date,
Date,
Thread,
Author