首页 > 系统相关 >shell 运算符

shell 运算符

时间:2022-10-08 16:44:09浏览次数:49  
标签:gt 小于 shell 运算符 例子 等于

shell中的比较运算符:

-eq       //等于
-ne       //不等于
-gt        //大于 (greater)
-lt         //小于 (less)
-ge       //大于等于
-le        //小于等于

例子:

                if [ "$mem" -gt 1400 ];then
                exit

 

shell中的布尔运算符:

==       //等于
!=       //不等于

 

例子:

                if [ "$exist" == "true" ];then
                sleep 1s

 

标签:gt,小于,shell,运算符,例子,等于
From: https://www.cnblogs.com/libruce/p/16769424.html

相关文章