shell常用条件表达式
来源:互联网 发布:p2p网络投资产品排行 编辑:程序博客网 时间:2024/06/05 20:49
文件表达式
if [ -f file ] 如果文件存在if [ -d ... ] 如果目录存在if [ -s file ] 如果文件存在且非空 if [ -r file ] 如果文件存在且可读if [ -w file ] 如果文件存在且可写if [ -x file ] 如果文件存在且可执行
整数变量表达式
if [ int1 -eq int2 ] 如果int1等于int2 if [ int1 -ne int2 ] 如果不等于 if [ int1 -ge int2 ] 如果>=if [ int1 -gt int2 ] 如果>if [ int1 -le int2 ] 如果<=if [ int1 -lt int2 ] 如果<
字符串变量表达式
If [ $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类似)
阅读全文
0 0
- shell常用条件表达式
- Shell 脚本中的算术运算与常用条件表达式
- shell 条件表达式
- shell 条件表达式
- shell 常用正则表达式
- shell 常用正则表达式
- shell 常用正则表达式
- shell 常用正则表达式
- shell 常用正则表达式
- shell 常用正则表达式
- shell 常用正则表达式
- Shell中条件表达式的一个用法
- shell条件表达式小结:test([])与 [[]]
- linux shell if 条件表达式总结
- Shell脚本[运算表达式,条件控制语句]
- shell编程中条件表达式的使用
- linux中shell条件表达式总结
- shell学习十七--条件表达式test、[]、[[]]
- idea使用maven项目中断点不可用的解决方法
- 基数排序
- Qt5.9.1 Windows下QPlainTextEdit无法正常垂直填充QFormLayout的问题
- 中国国内采购平台数据量规模排行
- mysql中多个left join子查询写法以及别名用法
- shell常用条件表达式
- 复制表结构和数据SQL语句
- Unsupported major.minor version 52.0解决方法
- 依赖注入
- 解决Python2操作中文名文件乱码的问题
- 简化栈运算
- C#常见面试问题
- 未来技术规划
- MySQL安装教程