--- tags: - bash --- The environment variable `RANDOM` contains an int between 0-32768. ``` min=10 max=20 echo $(($RANDOM%($max-$min+1)+$min)) 20 echo $(($RANDOM%($max-$min+1)+$min)) 14 ``` Using parameter [[Expansion]] we can just grab the first number: ``` ${RANDOM:0} ```