出现此错误的情况下,一般检查大小写,或者是格式上的错误:
发现:
func(){
if [ "`XXXX`" != "XXX" ]
then
echo "current user is not XXX, please chek ..."
else
echo "check XXX ... OK!"
fi
仔细查看,最后少了一个大括号,完整如下:
if [ "`XXXX`" != "XXX" ]
then
echo "current user is not XXX, please chek ..."
else
echo "check XXX ... OK!"
fi
}
问题得到解决,,,,,