shell判断表达式
来源:互联网 发布:linux open函数 编辑:程序博客网 时间:2024/04/27 20:50
if [ -f file] 如果文件存在
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 [ $string1 != $string2] 如果string1不等于string2
if [ -n$string ] 如果string 非空(非0),返回0(true)
if [ -z $string ] 如果string 为空
if [ $sting] 如果string非空,返回0 (和-n类似)
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 [ $string1 != $string2] 如果string1不等于string2
if [ -n$string ] 如果string 非空(非0),返回0(true)
if [ -z $string ] 如果string 为空
if [ $sting] 如果string非空,返回0 (和-n类似)
- shell判断表达式
- shell中的判断表达式
- Shell 表达式判断
- (5) Shell 判断表达式
- (10)shell 判断表达式
- shell的逻辑判断与表达式
- shell脚本判断闰年的逻辑表达式
- shell逻辑判断式与表达式
- 【原创】shell基本语法.正则表达式.逻辑判断实验....
- shell 判断
- Shell判断
- shell 判断
- shell判断
- 4.5、 Shell编程中判断判断表达式及if,for while循环 语句使用讲解
- shell表达式
- [shell][转载]shell 判断
- linux shell 指令 诸如-d, -f, -e之类的判断表达式
- linux shell 指令 诸如-d, -f, -e之类的判断表达式
- 微软Webcast课程下载软件iReaper正式登陆Android平台
- linux常用命令集
- Linux软中断实现详解(2.6.26.3)
- what is the fashion IDE in Linux CPP programming?
- 了解使用 ASP.NET AJAX 进行局部页面更新——ASP.NET AJAX学习笔记“出自msdn”
- shell判断表达式
- POJ 1068
- C#中textbox只能输入数字
- Android中包含多个Activity的应用退出按钮实现
- 关于用typedef定义结构体类型
- 临床路径实施难点探讨
- ping不通 虚拟机
- HBITMAP 保存为JPG格式
- 广州公安局综合办证厅地址