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

$RANDOM initial state doesn't change



I was trying to use $RANDOM for a simple 1/0 check, but it kept failing. After a while I realized a new subshell always gives the same $RANDOM result:

% for i in {1..10}; do echo `echo $RANDOM`; sleep 1; done
13490
13490
13490
13490
13490
13490
13490
13490
13490
13490

Surely it should be more random than that?

Tested with:

zsh 5.0.7 (x86_64-pc-linux-gnu)
zsh 5.0.2 (x86_64-apple-darwin12.2.0)



Messages sorted by: Reverse Date, Date, Thread, Author