[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep bug
From: |
Bill Zaumen |
Subject: |
grep bug |
Date: |
Fri, 13 Jun 2003 13:58:51 -0700 (PDT) |
I was trying a pattern that would look for lines containing only
IPv4 and IPv6 addresses and as one step used grep as follows:
grep -v '[^[:digit:]:.]'
This will match
192
192:2
but not
192.3
Similarly,
grep -v '[^[:digit:].:]'
will match
192
192.3
but not
192:3
Running
grep -v '[^:.[:digit:]]'
works as expected, matching lines containing only "192", "192.3"
and "192:3". All three patterns work as expected on Solaris using
the version of grep that comes with the system. I found the problem
on a Red Hat 9.0 x86 system.
Regards,
Bill