[oclug] sed (regexp) help needed
Joe Burpee
jeb at burkby.com
Fri Jul 25 09:23:02 EDT 2003
On Fri, Jul 25, 2003 at 08:54:08 -0400, Greg Franks wrote:
> >>>>> "Ross" == Ross Jordan <rjordan at student.math.uwaterloo.ca> writes:
> Ross> If you want to delete all lines containing your ip, just do:
>
> Ross> egrep -v "192.168.1.2" < mysite.com.log >
> Ross> mysite.com.cleansed.log
>
> Don't forget to escape the periods or your will match strings like
> 1291168112....
And in the other examples posted the single escapes are still not much
use; since the quotes are missing the shell will just strip off the
backslashes.
They need something like
sed "/^192\.168\.1\.2 /d" mysite.com.log
or
sed /^192\\.168\\.1\\.2\ /d mysite.com.log
Joe
More information about the OCLUG
mailing list