1.语法格式
if 条件测试1;then
命令序列1
elif 条件测试2;then
命令序列2
elif 条件测试3;then
命令序列3
else
命令序列n
fi
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f77cbe161cdbc6f25683ae493c7c67de.png)
2.吃鸡段位排行
#!/bin/bash
#Author:hejing
#Date:2021-7-22
#Description:吃鸡结束后输入自己的分数,判断是什么段位
#得分<=30:热血青铜
#得分31-40:不屈白银
#得分41-60:英勇黄金
#得分61-70:坚韧铂金
#得分71-80:不朽星钻
#得分81-90:荣耀皇冠
#得分>90:超级王牌
read -p "恭喜吃鸡,输入你的分数,让我检测侬是啥段位吧:" score
#if [ $score -le 30 ];then
# echo "你刚玩吧,还是个青铜啊!"
#elif [ $score -le 40 ];then
# echo "不宁不屈,还行,你是个白银!"
#elif [ $score -le 60 ];then
# echo "书中自有黄金屋,加油,黄金!"
#elif [ $score -le 70 ];then
# echo "铂金当然比黄金值钱了,奥利给铂金!"
#elif [ $score -le 80 ];then
# ech