shell 中的 if-elif-else 语句使用实例
2011-12-13 13:00
1161 查看
#!/bin/sh #shellThird.sh # to show the method of if echo -n "Enter the first integer:" read First echo -n "Enter the second integer:" read Second if [ "$First" -gt "$Second" ] then echo "$First is greater than $Second" elif [ "$Second" -gt "$First" ] then echo "$Second is greater than $First" else echo "$First is equal to $Second" fi
相关文章推荐
- Linux-Shell脚本编程-学习-5-Shell编程-使用结构化命令-if-then-else-elif
- shell脚本实例 使用exit语句和if
- Python3使用独立的if语句与使用if-elif-else结构的不同之处
- shell中if语句的使用要点!
- 使用shell的if else fi语句和注意的地方
- 详解Lua中if ... else语句的使用方法
- [Shell] if、for、while流程语句以及整数字符串判断比较的实例详解
- shell的if else 语句
- Python中条件判断 if, elif, else的使用
- [Shell] if、for、while流程语句以及整数字符串判断比较的实例详解
- 循环语句中的if else 结构里面如何使用break语句?
- SQL语句中如何使用含有if....else...判断语句
- Python中在for循环中嵌套使用if和else语句的技巧
- 题目:求1+2+…+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字以及条件判断语句(A?B:C)
- shell脚本编程-使用结构化命令(if/else)(转)
- Shell 脚本基础 - 使用 if 语句进行条件检测
- shell中if语句的格式以及使用
- Shell脚本语法-- if/then/elif/else/fi
- 第二章:shell结构化语句 if else & case
- Shell if...elif...fi 语句