天天看点

查找文件中的字符串

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