格式如下,在比较时,数字和字符串用不同的比较符号
1.如果a>b且a b )) && (( a < c ))
或者
if [[ $a > $b ]] && [[ $a < $c ]]
或者
if [ $a -gt $b -a $a -lt $c ]
2.如果a>b或a b )) || (( a < c ))
或者
if [[ $a > $b ]] || [[ $a < $c ]]
或者
if [ $a -gt $b -o $a -lt $c ]
- -o = or , -a = and , 但我一向只用 || 或者 &&
4."||“和”&&"在SHELL里可以用吗?也就是第一个写成if [ a>b && a
关注
打赏
热门博文
- ArrayList c.toArray might (incorrectly) not return Object[] (see 6260652)
- Spring框架实体bean转json返回前端报错:Null key for a Map not allowed in JSON (use a converting NullKeySerializer
- python将数据写入txt文本文件
- Python学习随笔:使用xlwings读取和操作Execl文件
- org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unrecognized t
- ‘gbk‘ codec can‘t decode byte 0x80 in position 2: illegal multibyte sequence
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- 关于Mybatis中keyProperty属性
- 解决 Mybatis 报错 org.apache.ibatis.ognl.NoSuchPropertyException: XXXCriteria$Criterion.noValue
- mysql报错 is longer than the server configured value of ‘wait_timeout‘