~图形脚本加(双色球小脚本)*
作者:互联网
#!/bin/bash
#99乘法口诀
for i in {1..9}
do
for j in {1..9}
do
if [ $j -le $i ]
then
echo -n " ${j}x${i}=$(($i*$j)) "
fi
done
echo
done
echo
echo #三角形 变 M 形
for ((i=1;i<=9;i++))
do
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((j=9;j>=$i;j--))
do
echo -n " "
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
#隔开
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((j=9;j>$i;j--))
do
echo -n "*"
done
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done echo done
echo
echo #金字塔形
for ((i=1;i<=9;i++))
do
for ((j=9;j>=$i;j--))
do
echo -n " "
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
for ((j=1;j<$i;j++))
do
echo -n "*"
done
echo
done
echo
echo #长方形
for ((i=1;i<=9;i++))
do
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
echo
done
echo
echo #结束了
#双色球
echo "第19100期开奖结果 开奖日期:$(date +'%F %T')"
touch /number
aa=0 for ((i=1;${aa}<6;i++))
do
num=$(expr $RANDOM % 33 + 1)
cat /number | grep $num &> /dev/null
if [ $? -ne 0 ]
then echo "$num" >> /number
echo -en "\033[31m$num \033[0m"
let aa++
else continue
fi
done echo -en "\033[34m$(expr $RANDOM % 16 + 1)\033[0m"
echo
rm -rf /number
#结束了
#99乘法口诀
for i in {1..9}
do
for j in {1..9}
do
if [ $j -le $i ]
then
echo -n " ${j}x${i}=$(($i*$j)) "
fi
done
echo
done
echo
echo #三角形 变 M 形
for ((i=1;i<=9;i++))
do
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((j=9;j>=$i;j--))
do
echo -n " "
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
#隔开
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((j=9;j>$i;j--))
do
echo -n "*"
done
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done echo done
echo
echo #金字塔形
for ((i=1;i<=9;i++))
do
for ((j=9;j>=$i;j--))
do
echo -n " "
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
for ((j=1;j<$i;j++))
do
echo -n "*"
done
echo
done
echo
echo #长方形
for ((i=1;i<=9;i++))
do
for ((j=9;j>=$i;j--))
do
echo -n "*"
done
for ((j=1;j<=$i;j++))
do
echo -n "*"
done
echo
done
echo
echo #结束了
#双色球
echo "第19100期开奖结果 开奖日期:$(date +'%F %T')"
touch /number
aa=0 for ((i=1;${aa}<6;i++))
do
num=$(expr $RANDOM % 33 + 1)
cat /number | grep $num &> /dev/null
if [ $? -ne 0 ]
then echo "$num" >> /number
echo -en "\033[31m$num \033[0m"
let aa++
else continue
fi
done echo -en "\033[34m$(expr $RANDOM % 16 + 1)\033[0m"
echo
rm -rf /number
#结束了
标签:脚本,do,双色球,number,echo,num,done,033,图形 来源: https://www.cnblogs.com/123456likun/p/11438493.html