yitzle schreef:

> If you are on a Linux machine, it might just be easier
> to use the grep command with a shell script.
>
> FILE_NAME="./log"
> TMP_FILE="./tmp"
> IP_TO_REMOVE="192.168.0.0|192.168.0.255"
>
> COUNT=`grep $IP_TO_REMOVE $FILE_NAME | wc -l`
> echo "The IPs occur $COUNT times"
>
> grep -v $IP_TO_REMOVE $FILE_NAME > $TMP_FILE
> mv $TMP_FILE $FILE_NAME

Be careful, the 192.168.0.0 can also match a line with 192.168.010 in
it. See also the -F option of grep.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to