shell条件判断式语句下
来源:互联网 发布:网络基础知识学习 编辑:程序博客网 时间:2024/06/16 22:11
一 字符串判断
二 实战
[root@localhost ~]# name=fengji
[root@localhost ~]# [ -z $name ] && echo yes || echo no
no
[root@localhost ~]# name=""
[root@localhost ~]# [ -z $name ] && echo yes || echo no
yes
[root@localhost ~]# aa=11
[root@localhost ~]# bb=22
[root@localhost ~]# [ "$aa" == "$bb" ] && echo yes || echo no
no
[root@localhost ~]# [ "$aa" -eq "$bb" ] && echo yes || echo no
no
[root@localhost ~]# aa=22
[root@localhost ~]# [ "$aa" -eq "$bb" ] && echo yes || echo no
yes
[root@localhost ~]# [ "$aa" == "$bb" ] && echo yes || echo no
yes
三 多重条件判断
四 实战
[root@localhost ~]# aa=22
[root@localhost ~]# [ -n "$aa" -a "$aa" -gt 33 ] && echo yes || echo no
no
[root@localhost ~]# [ -n "$aa" -a "$aa" -gt 3 ] && echo yes || echo no
yes
阅读全文
0 0
- shell条件判断式语句下
- shell条件判断式语句
- shell 条件判断式语句
- shell条件判断式语句中
- linux shell条件判断语句
- linux shell条件判断语句
- linux shell条件判断语句
- Shell条件判断语句上
- Linux Shell下条件语句:
- Linux Shell下条件语句
- Linux Shell下条件语句
- shell条件判断式
- shell -- 条件判断式
- shell-条件判断式
- linux shell中的条件判断语句
- 04 shell条件测试和判断语句
- shell编程基础(3)条件判断语句
- shell 条件判断语句参数介绍
- maven介绍及环境搭建
- Shell条件判断语句上
- 序列化中子父类构造函数问题
- 选择排序
- shell条件判断式语句中
- shell条件判断式语句下
- maven常用的构建命令
- 第一个maven案例hellomaven
- 学习shell小窍门
- 趣图:我是不是被录取了??
- 九度1005
- shell单分支if语句
- 事件分发
- shell双分支if语句