shellScript之if_elif_else语句
来源:互联网 发布:唱歌调音软件 编辑:程序博客网 时间:2024/06/05 09:10
#!/bin/bashecho "Please input the score between(0-100):"read scoreif [ "$score" -ge 90 ];then echo "The grade is A ~"elif [ "$score" -ge 80 ];then echo "The grade is B~"elif [ "$score" -ge 70 ];then echo "The grade is C ~"elif [ "$score" -ge 60 ];then echo "The grade is D ~"else echo "The grade is E~"fi
结果:
~/Note/test # ./3if_elif_else.sh Please input the score between(0-100):90The grade is A ~~/Note/test # ./3if_elif_else.sh Please input the score between(0-100):80The grade is B~~/Note/test # ./3if_elif_else.sh Please input the score between(0-100):70The grade is C ~~/Note/test # ./3if_elif_else.sh Please input the score between(0-100):60The grade is D ~~/Note/test # ./3if_elif_else.sh Please input the score between(0-100):50The grade is E
阅读全文
0 0
- shellScript之if_elif_else语句
- shellScript之if_else语句
- shellScript之case语句
- shellScript之for语句
- shellScript之while语句
- shellScript之while语句
- shellScript之util语句
- shellScript之continue语句
- shellScript之select语句
- shellScript之嵌套if_else语句
- shellscript之简单的if语句
- shellScript之位置参数
- shellScript之break关键字
- shellScript之hello函数
- shellScript之数组操作1
- shellScript之数组操作2
- shellScript之数组操作3
- shellScript之数组操作4
- 我的前端里程碑
- vue切换端口
- 日志服务十大经典问题
- jQuery缓存实现的分析-及源码解读
- 数据结构与算法一:选择排序
- shellScript之if_elif_else语句
- PHP中数组模糊匹配字符串
- 还在用密码登录 ECS?ECS 控制台更安全的 SSH 密钥对 来了
- shellScript之case语句
- 学习的步伐(三)Kotlin TabLayout+Viewpager+Fragment实现基础框架
- 进程和线程
- 从入门型到企业型:云服务器开放共享型到独享型规格升级变配
- 似是故人来——电影《山河故人》赏析
- 实现系统函数time,获取当前时间与UTC的间隔