Tag: shell scripts
Testing Random Randomness…
by Eric on Feb.10, 2009, under Scripts
A post at Manik 2.0 got me thinking on whether or not the $RANDOM variable in bash was really all that random. So, I created a little test script. It's quite simple. It accepts a command line argument for number of loops. Then, each loop, it assigns a random number to $RANDTEST, and then compares $RANDTEST to $RANDOM. Since $RANDOM changes every time, it should never, ever match.




