Generating random numbers is bit easier as compare to generating random numbers in other languages.
To generate a random number in shell script use below command
The above command is case sensitive and hence
Generating random number with in a range
-Thank you
To generate a random number in shell script use below command
$RANDOM
The above command is case sensitive and hence
$random
will not give you desire result.Generating random number with in a range
lr=100 # lower range ur=600 # upper range r=`expr $ur - $lr` echo "The random number of `expr $RANDOM % $r + $lr`"
-Thank you
No comments:
Post a Comment