设置一个双色球脚本(2)并带颜色输出
#!/bin/bash
RED='\033[31m'
BLUE='\033[34m'
END='\033[0m'
echo -en "$RED 红色:$END"
#sleep 3
while true
do
red=$[$RANDOM%33+1]
echo $redstring | grep -qw $red && continue
echo -ne " $RED$red$END"
redstring="$redstring $red"
sleep 1
[ `echo $redstring | awk "{print NF}"` -eq 6 ] && break
done
echo
echo -ne "$BLUE 篮球:$END \t"; sleep 1
echo -e "$BLUE $[ $RANDOM%16+1 ] $END "
用代码改变命运,加油,努力,陌生人!