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

broken random variable



Hello, zsh-workers

I found a bug in the $RANDOM variable; on OpenBSD, the command "echo $RANDOM | tee" will print the same number
across different executions of the same command, and the value of "echo $RANDOM" will be the same as the last value.
At first I thought that this bug was limited to OpenBSD, because it was not reproduced on the website "rootnroll" which has
a demo for "oh my zsh", but today I tested another command on the website:  "yes | while read; do echo $RANDOM; done | head",
and all the random numbers are the same across different executions of the command. I hope that's enough information for you.
I reported the first bug to OpenBSD on monday, and Theo de Raadt replied and said that I should tell you instead.
I guess this  e-mail might be a bit late, but I was waiting for evidence that it can be reproduced elsewhere.

PS: I would recommend using "arc4random" on OpenBSD if that is at all possible.

Thanks for reading my message. Good day.



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