1. Shell expression
A = 3; B = 2; C = 4
If (A> B) & (A <C ))
Or
If [[$ A> $ B] & [[$ A <$ C]
Or
If [$ A-GT $ B-A $ A-lt $ C]
2.-O = or,-A = And, but I have always used | or &&
3. Other explanations
-Ne comparison number (numberic );! = Comparison character (string), but the latter can also be used to compare numbers, but it is not a standard usage.
-Lt is Equivalent <, but <It can only be used in Shell numeric operators () or intercept operators [].,-Lt,-EQ,-GT,-Ge,-Le,These are test, which is the conditional operator used by the [] built-in command,Used to compare numbers; = ,! = Use to compare characters; = This is used in [[]. It can be used to compare regular expressions, but it can also be used in [], but it is not quite orthodox.
In addition, there are many other comparable test expressions [], such as comparison of files and directories.
Original article:
Http://zhidao.baidu.com/question/107290842.html
Http://www.233.com/linux/fudao/20091201/095719620-2.html