shell 比较-eq和=

-eq

用于 INTEGER 类型比较。code

INTEGER1 -eq INTEGER2
    INTEGER1 is equal to INTEGER2

=

即适用于 STRING 类型比较,又适用于 INTEGER 类型比较。string

STRING1 = STRING2
    the strings are equal
STRING1 != STRING2
    the strings are not equal
INTEGER1 -eq INTEGER2
    INTEGER1 is equal to INTEGER2
相关文章
相关标签/搜索