why the code below, supposed to display a random from 2-3 range, actually works as if the range was 2-4?
echo $((RANDOM%3+2))
|
why the code below, supposed to display a random from 2-3 range, actually works as if the range was 2-4?
|
|||||
|
|
To answer your question:
0, 1 and 2 +2 then: 2, 3 and 4 |
||||
|
|
|
Try doing this instead if you want a reliable way :
|
||||
|
|