Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: random once but not twice



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