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

Re: use of rand() in zsh



> On 11/10/2022 13:51 Clinton Bunch <cdb_zsh@xxxxxxxxxxx> wrote:
> 1. Implement a shopt that changed the behavior of RANDOM (Pleasing 
> because of the elegance of using RANDOM for good random values, but 
> probably too confusing)
> 
> 2. Simply implement a new parameter called SRANDOM (simplest, but change 
> to core zsh interface)
> 
> 3. Write a module (e.g. zsh/random) that introduced a new special 
> parameter when loaded (more complicated, but isolated to those who want 
> it and possible to fail on systems that don't have a kernel entropy pool)

An autoloadable parameter gives you something that works basically as if
it's part of the shell but can be turned off as well as giving an error
if the module isn't available, so might be the best bet.  So the
.mdd file would have

autofeatures=p:SRANDOM

pws




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