On Sat, 2003-08-09 at 14:38, Robert P. J. Day wrote: > On 9 Aug 2003, Bret Hughes wrote: > > > On Sat, 2003-08-09 at 10:41, Robert P. J. Day wrote: > > > > > > as part of a shell script, i'd like to generate a random > > > number (preferably an integer), but i'd like to do it in a > > > POSIX-compliant way. > > > > > > AFAICT, using the $RANDOM variable is not POSIX-compliant -- > > > that variable is not defined in a strict POSIX shell. > > > > > > any other suggestions? perhaps reading a number of bytes > > > from /dev/urandom or something? > > > > > > rday > > > > > > here is one that turned up on a google search uses /dev/urandom if it > > exists. Not sure about the POSIX stuff but the guts of the dd > > if=/dev/urandom is down in the bottom if statement. > > > > http://www.shelldorado.com/scripts/cmds/rand.txt > > great googly moogly! sure is a production just to get a random > number. i miss the $RANDOM variable already. >
Also, I don't know about the quantity or the true randomness of the urandom stuff. I know when I first started dinking with ipsec about three years ago, I did not have enough entropy to finish the key generation stuff. I turns out that most of it gets generated via keyboard, mount and ide harddrive activity and I was compiling on a scsi server remotely and that lead me down a big ol rabbit trail concerning randomness. Crytographers take their randomness seriously. Bret -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list