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

Re: rigorously predictable random numbers





On 2024-05-02 20:09, Lawrence Velázquez wrote:
	The values of RANDOM form an intentionally-repeatable
	pseudo-random sequence; subshells that reference RANDOM
	will result in identical pseudo-random values unless the
	value of RANDOM is referenced or seeded in the parent shell
	in between subshell invocations.
Ok then at least this is intentional.  How does one obtain a genuinely random number then?  TBH, for my particular needs right now the standard behavior is perfect, but as a matter of principle I'd like to know how to get 'real' random numbers.  There will be a way.

There are no other shells, other than the $(...) subshells.  You
are using the "." command, which sources the given script in the
current shell.
Yes, pardon.  I get it mixed up with $( ) and with piping. 
https://www.zsh.org/mla/workers/2015/msg00549.html
https://www.zsh.org/mla/workers/2017/msg00586.html
https://www.zsh.org/mla/users/2017/msg00618.html
https://www.zsh.org/mla/workers/2019/msg00887.html
https://www.zsh.org/mla/workers/2023/msg00012.html
https://www.zsh.org/mla/workers/2023/msg00208.html
https://www.zsh.org/mla/users/2023/msg00475.html

How do you do that?  It would save a lot of repetition if I could research the archives myself.    Such a resource, but inaccessible -- tho you seem to know how.  It bothers me to ask a question that I know has been asked before.





    



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