shell 随机数 2022-11-02 Source Edit History shell创建随机数 Catalogue 1. 使用linux uuid2. 参考链接 使用linux uuid1234567891011#!/bin/bashfunction rand(){ min=$1 max=$(($2-$min+1)) num=$(cat /proc/sys/kernel/random/uuid | cksum | awk -F ' ' '{print $1}') echo $(($num%$max+$min))}rnd=$(rand 100 500)echo $rnd 参考链接shell 生成指定范围随机数与随机字符串