random number in bash code example Example 1: get random number shell script $(( ( RANDOM % 10 ) + 1 )) Example 2: bash random number $ echo $(( $RANDOM % 10 ))