在shell脚本中,使用-eq、-ne、-gt、-ge、-lt、-le进行整数的比较。英文意思分别为:

-eq :equal(相等)

-ne :not equal(不等)

-gt :greater than(大于)

-ge :greater than or equal(大于或等于)

-lt :less than(小于)

-le :less than or equal(小于或等于)

注意:在shell中这些符号只能用于整数的比较,不能用于字符串。