我是shell脚本的新手。我无法弄清楚为什么下面的脚本会弹出警告,说有些遗漏了“"”?有人可以帮我看看吗?
if [ $portalweb_prepared == "true"];then
CHECK="false";
elif [ $ims_prepared == "true"] &&[ $same_version == "false" ];then
CHECK="false";
elif [ $portalapi_prepared == "true"] &&[ $same_version == "false" ];then
CHECK="false";
fi
答案 0 :(得分:1)
这应该写成如下:
if [ "$portalweb_prepared" = "true" ]
then
CHECK="false"
elif [ "$ims_prepared" = "true" ] && [ "$same_version" = "false" ]
then
CHECK="false"
elif [ "$portalapi_prepared" = "true" ] && [ "$same_version" = "false" ]
then
CHECK="false"
fi
非常相似,但几乎所有空间都很重要,其余部分都有助于阅读。