zsh-workers
 help / color / mirror / code / Atom feed
* broken random variable
@ 2019-10-19  5:38 
  2019-10-19  5:44 ` Roman Perepelitsa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From:  @ 2019-10-19  5:38 UTC (permalink / raw)
  To: zsh-workers

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-19 14:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-19  5:38 broken random variable 
2019-10-19  5:44 ` Roman Perepelitsa
2019-10-19  6:09   ` Daniel Shahaf
2019-10-19  9:48 ` Sebastian Gniazdowski
2019-10-19 14:31 ` Mikael Magnusson

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).