shell下变量比较最佳实践
https://stackoverflow.com/questions/13617843/unary-operator-expected ? If you know you‘re always going to use bash,it‘s much easier to always use the double bracket conditional compound command if [[ $aug1 == "and" ]]; to compare the value of If you use if [ "$aug1" = "and" ]; If you don‘t quote the variable expansion and the variable is undefined or empty,it vanishes from the scene of the crime,leaving only if [ = "and" ]; which is not a valid syntax. (It would also fail with a different error message if The modern (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |