Search This Blog

Thursday, April 24, 2014

Random Numbers

Random numbers can be produced like most of the other programming languages in unix with the key word RANDOM .

$echo $RANDOM
29003
$echo $RANDOM
4613

PS: Required number of digits can then be produced by doing module (%).

$echo $((${RANDOM} % 120}
4

No comments:

Post a Comment