#!/bin/bash
#Author:Sunshihe
#----------
#Time:2020-04-29 09:04:41
#Name:test12.sh
#Version:V1.0
#Description:This is a test script.
while true
do
Log=/tmp/zhuajiu.log
[ -f $Log ]||touch $Log
read -p "input your English name:" name
if [ -z $name ];then
continue
else
while true
do
flag=0
ran_num=$(expr $RANDOM % 99 + 1)
zhua_num=$(grep "\b${ran_num}\b" $Log|wc -l)
if [ $zhua_num -ne 1 ];then
echo "$name ${ran_num}"|tee >>$Log
flag=1
fi
[ $flag -eq 1 ]&& break
done
fi
done
===========================================================================================
抓阄实现
最新推荐文章于 2021-03-09 20:52:15 发布