最佳答案
在 bash
中,等于和双等于测试运算符之间的差别是什么(如果有的话) ?
[[ "a" = "a" ]] && echo equal || echo not-equal
[[ "a" == "a" ]] && echo equal || echo not-equal
[[ "a" = "b" ]] && echo equal || echo not-equal
[[ "a" == "b" ]] && echo equal || echo not-equal
结果:
equal
equal
not-equal
not-equal