O'Reilly logo

Shell Scripting Recipes: A Problem-Solution Approach, Second Edition by Jayant Varma, Chris F. A. Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 15

image

Random Acts of Scripting

The generation of random numbers is too important to be left to chance.

—Robert R. Coveyou, Oak Ridge National Laboratory

Although it may often seem otherwise, computers are very predictable; they do exactly what they are told (i.e., programmed) to do. Randomness is the antithesis of predictability, and this makes the generation of random number by a computer problematic.

There are two general methods used by computers to generate random numbers: hardware and software. A hardware generator may be a dedicated device, noise from device drivers, or some other source. The software method uses a pseudo-random number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required