====== 10 IPアドレス判定 ====== if [ -n "`echo $IP |sed 's/^\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)//g'`" ];then echo "IPアドレスではありません。" exit fi ===== 単純にgrepで検索 ===== grep -e "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /var/log/secure こっちの方が正確 grep -e "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" /var/log/secure {{tag>bash}}