Random
by vmill from LinuxQuestions.org on (#56Y21)
Not sure if programming forum is best but I am trying a simple script on Fedora for a random number generator. I know it is not truly random and am ok with a cheesy hack.
I searched and found "generate random number in specific range" examples:
generating a random number between 11 and 30: echo $[ $RANDOM % 20 + 11 ]
It seems to work, but where does 20 come into anything? In other examples I found, the first number is the high end of the range. If I wanted something random between 10 & 15 what would I use?
Confused


I searched and found "generate random number in specific range" examples:
generating a random number between 11 and 30: echo $[ $RANDOM % 20 + 11 ]
It seems to work, but where does 20 come into anything? In other examples I found, the first number is the high end of the range. If I wanted something random between 10 & 15 what would I use?
Confused