我有一个shell if语句,如下所示:
if($var1!= $var2) then
...
endif
当字符串var1的值为“(” 时,出现以下错误:
if: Expression Syntax
我知道(是一个语法字符,我想知道是否有任何可比较的字符串值用于(
谢谢。
最佳答案
最终,我找到了一个解决该错误问题的间接方法:
if(`echo $var1` != `echo $var2`) then
...
endif
但我仍然希望收到更酷的答案。谢谢。
关于shell - CSH如果: “Expression Syntax” Error for String Comparison with the value “(” ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35202760/