$ echo $(( $RANDOM % 10 ))
$(( ( RANDOM % 10 ) + 1 ))
#If you have coreutils installed and want a number inbewtween a value
shuf -i MIN-MAX -n 1
#or you can use bash
$RANDOM
$ echo $((1 + $RANDOM % 10))
3
echo $RANDOM
echo $(( $RANDOM % 50 + 1 ))
DIFF=$((Y-X+1))
R=$(($(($RANDOM%$DIFF))+X))
function random_element {
declare -a array=("$@")
r=$((RANDOM % ${#array[@]}))
printf "%s
" "${array[$r]}"
}