shell for循环

for((i=0;i<120;i++))
do
result=`echo dump|nc 127.0.0.1 2181 |grep runtime|grep service |grep vipapis.inventory`;
if [ "${result}" = "" ]
then
#echo $result;
echo "service not found in ZK, waiting ...";
sleep 1;
fi
done

参考:http://www.linuxidc.com/Linux/2012-02/53030.htm

原文地址:https://www.cnblogs.com/dannyyao/p/6755448.html