#!/bin/sh awk '{print $0}' /data/intffile/test3.log | sed 's/€/ /g' | while read size do if [ $size -eq 0 ];then echo " Êý¾ÝµÈÓÚ0¡£ " exit 1 fi if [ $size -gt 0 ];then success=1 if [ "$success" -gt 0 ];then echo "add_error 1" exit 1 fi fi done echo "ΪʲôÕâ¶Î´úÂëÖ´ÐÐÁË£¿£¿"
³ÌÐòÀïʵÏÖµÄÈç¹û¶ÁÈ¡µ½0£¬Ôòexit 1 ,µ«ÊÇwhileÍâÃæµÄ echo "ΪʲôÕâ¶Î´úÂëÖ´ÐÐÁË£¿£¿" Ò²Ö´ÐÐÁË£¬ ÈçºÎÄܶÁÈ¡µ½0¾ÍÍ˳öµ±Ç°shell,±ðÖ´ÐÐwhileÍâÃæµÄ³ÌÐò
while read size ÊÇ¿ªÆôÁËÒ»¸öеÄshellµÄ¡£ÄãµÄexitÓï¾äÔÚ×ÓshellÖУ¨while read sizeÕâ¸öshell£©£¬Òò´ËËüÖ»ÄÜÍ˳öwhile read sizeÕâÒ»ÃüÁî¡£ ËùÒÔºóÃæµÄecho¾Í»¹»áÖ´ÐÐÁË¡£ ÀàËÆCÓïÑÔÖÐreturn¡£
shell½Å±¾ÖУ¬ÄãʹÓÃÒ»¸öÃüÁî»áÆô¶¯Ò»¸öеÄshell£¬¸ÃshellÖ´ÐÐÍ꣬Í˳ö¸Ã×Óshell£¬¶ÁÈ¡ÏÂÒ»ÐÐÃüÁÔÙ¿ªÆôÒ»¸öshell¡¡
|