linux脚本 随机数
来源:互联网 发布:软件回归测试 编辑:程序博客网 时间:2024/04/30 04:04
#!/bin/bash
#$RANDOM 5 bit random number
#random one parameter integer
random()
{
systemRandom=$RANDOM;
myRandom=$(($systemRandom%$1));
echo $myRandom;
}
out=$(random 3);
if [ $out -eq 0 ] ; then
echo $out;
elif [ $out -eq 1 ] ; then
echo $out;
elif [ $out -eq 2 ] ; then
echo $out;
elif [ $out -eq 3 ] ; then
echo $out;
fi
for (( i = 0; i < 10 ; i ++ ))
do
echo $i , $(random 10);
done
#$RANDOM 5 bit random number
#random one parameter integer
random()
{
systemRandom=$RANDOM;
myRandom=$(($systemRandom%$1));
echo $myRandom;
}
out=$(random 3);
if [ $out -eq 0 ] ; then
echo $out;
elif [ $out -eq 1 ] ; then
echo $out;
elif [ $out -eq 2 ] ; then
echo $out;
elif [ $out -eq 3 ] ; then
echo $out;
fi
for (( i = 0; i < 10 ; i ++ ))
do
echo $i , $(random 10);
done
0 0
- linux脚本 随机数
- shell脚本产生随机数
- shell 脚本随机数问题
- 加随机数引入脚本
- 随机数和动画脚本
- Linux 随机数
- shell 脚本中的 随机数生成
- shell脚本生成随机数方法
- linux下的随机数
- linux 随机数 理论
- linux shell实现随机数
- LINUX随机数的产生
- Linux 的随机数
- linux产生随机数
- Linux RANDOM 随机数
- linux产生随机数
- linux内核随机数产生器
- linux下产生随机数
- 多线程编程:任务取消
- socket通信 客户端与服务端
- datagrview导出excel
- SQL-三个月之内累计消费满1000元的卡号
- start bluestacks模拟器中文版 v0.8.9 官方PC版
- linux脚本 随机数
- Wireless Tools for Linux
- 启动文件rc.local、/etc/bash.bashrc、~/bashrc、/etc/profile、~/.profile【转载from joyride】值得了解
- 虚拟机ubuntukylin 13.10 忘记root密码解决办法
- 使用 PVRTC 压缩格式创建纹理(Creating textures in the PVRTC compression format)
- 鞋子的风水
- 鞋子心理学
- struts拦截器includeMethods或excludeMethods没起作用
- 如何让别人PING不通你的机器