1 a="" 2 b="" 3 if [ "$a" == "$b" ] 4 then 5 echo "==" 6 else 7 echo "!=" 8 fi若使用"==",则会报错如下:
sh t2.sh
t2.sh: 3: [: unexpected operator
!=
如果使用"=",则通过:
[arthur@E430 ~/workspace/test]$sh t2.sh
==
linux下"="号与"=="号,布布扣,bubuko.com
原文:http://blog.csdn.net/arthur503/article/details/38308579