#/bin/bash echo "---------------产生随机数---------------" read -p "请输入起始数:" a read -p "请输入终止数:" b if [ $a -lt $b ] then c= expr $(date +%N) % $[ $b - $a + 1 ] + $a echo "$c" else echo "---------------请重新输入!---------------" echo echo echo sh 2.sh fi
#/bin/bash echo "---------------产生随机数---------------" read -p "请输入起始数:" a read -p "请输入终止数:" b if [ $a -lt $b ] then c= expr $(date +%N) % $[ $b - $a + 1 ] + $a echo "$c" else echo "---------------请重新输入!---------------" echo echo echo sh 2.sh fi