James Carlson wrote: > I don't think there's really a good option available with just one > mechanism. > > If you make $RANDOM "really random" by default, but revert to normal > seeded rand() mode when written to, then users will be confused. On > some platforms, reading from $RANDOM alone (without initializing) will > produce high quality random numbers. On other platforms, it'll > produce the worst-possible randomness. If smart users try to make > their applications robust by writing $$ (or some such) to $RANDOM, > they'll perversely end up with lower quality randomness by accident on > platforms that have /dev/urandom (which isn't just Solaris, but may > not be all platforms). > > I think it'd be better to keep the default $RANDOM behavior, and > create a new $URANDOM defined to return higher-quality randomness > without initialization.
I second that. And though James has summarised well, I'd like to stress that the use of ${RANDOM} has a documented interface - the fact that you can assign a seed to it implies a pseudo-random series. I also support Roland's proposal, but there should be a separate interface. "Change an interface, change the name" is the holy writ in Solaris. (and should be in all systems development) Cheers, Henk