Shell if
来源:互联网 发布:小猪cms源码2017 编辑:程序博客网 时间:2024/04/25 00:05
条件表达式
file ] 如果文件存在
if [ -d ... ] 如果目录存在
if [ -s file ] 如果文件存在且非空
if [ -r file ] 如果文件存在且可读
if [ -w file ] 如果文件存在且可写
if [ -x file ] 如果文件存在且可执行
如果int1等于int2
if [ int1 -ne int2 ] 如果不等于
if [ int1 -ge int2 ] 如果>=
if [ int1 -gt int2 ] 如果>
if [ int1 -le int2 ] 如果<=
if [ int1 -lt int2 ] 如果<
[ $a = $b ] 如果string1等于string2
字符串允许使用赋值号做等号
if [ $string1 != $string2 ] 如果string1不等于string2
if [ -n $string ] 如果string 非空(非0),返回0(true)
if [ -z $string ] 如果string 为空
if [ $sting ] 如果string 非空,返回0 (和-n类似)
- 文件表达式
if [ -d ...
if [ -s file
if [ -r file
if [ -w file
if [ -x file
- 整数变量表达式
if [ int1 -ne int2 ]
if [ int1 -ge int2 ]
if [ int1 -gt int2 ]
if [ int1 -le int2 ]
if [ int1 -lt int2 ]
-
字符串变量表达式
if
if
if
if
0 0
- shell if
- shell if
- shell:if
- shell if
- shell-if
- shell if
- shell if
- shell-if
- shell if
- shell if
- SHELL if
- shell if
- shell if
- Shell if
- 【shell】 if
- shell if
- shell if
- shell if [ ]
- Android中解析XML
- Break Free of Code Deadlocks in Critical Sections Under Windows
- 文本属性Attributes-也是多文本的拓展感觉比较好分享给大家
- 优步很酷么?
- 好好做点事
- Shell if
- 可是我不愿意陪你做一只蘑菇
- Ubuntu安装搜狗输入法、flashplayer、配置VPN(三)
- LeetCode(Subsets)
- 300个国外优秀网站
- 九章算法面试题33 数组波峰
- 执行SVN up和svn merge等命令出现在首位置的各字母含义以及SVN合并别人的修改
- 利用堆栈进行四则运算
- [LeetCode] Pascal's Triangle II