语法:
if [ condition ]
then
statements for when the condition is true
else
statements for when the condition is false
fi
then
statements for when the condition is true
else
statements for when the condition is false
fi
实例,判断一个文本中是否包含ret
if [ $`cat /tmp/erlogret.txt |grep "ret"` ]
then
echo "any web application is ok"
else
echo "some web application is error,please call jackzou"
fi
then
echo "any web application is ok"
else
echo "some web application is error,please call jackzou"
fi