(1)通过内部系统变量($RANDOM) echo $RANDOM #!/bin/bash function rand(){ min=$1 max=$(($2-$min+1)) num=$(($RANDOM+