我有一个如下的变量。
variable = This script is not found
if [[ "$variable" = ~ "not found" ]];
then
echo "Not Found"
else
echo "Its there"
if
在执行时出现以下错误,
line 4: syntax error in conditional expression
./test.sh: line 4: syntax error near `found"'
./test.sh: line 4: `if [[ "$variable" = ~ "not found" ]]; '
有人能指出我在这里缺少什么吗?
”之间不应该有空格。请写成“=”。 - Explosion Pills附近有语法错误./test.sh: 第4行:`if [[ "$variable" ="not found" ]]; ' - Bobyvariable="This script is not found"
,会发生什么?祝好运。 - shellter