if [ 'AAA' = 'ABC' ];
then 
    echo "the same" 
else 
    echo "not the same"
fi

shell比较字符串只能用=,不能用eq!

注意,加黄底色部分空格必不可少!

相关文章: