天天看點

查找檔案中的字元串

essid="MEIZU"

ess_file="/tmp/essid_ap.log"

#找到傳回1,沒找到傳回0 

if [ 1 -eq `grep -c $essid $ess_file` ]

        then

                echo "2222"

        else

                echo "3333"

        fi