|Summary:||grep outputs mismatched patterns|
|Product:||[Retired] Red Hat Linux||Reporter:||Zhao Wu <zhao_wu>|
|Component:||grep||Assignee:||Tim Waugh <twaugh>|
|Status:||CLOSED NOTABUG||QA Contact:||Mike McLean <mikem>|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2003-01-10 09:38:18 UTC||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
|Cloudforms Team:||---||Target Upstream Version:|
Description Zhao Wu 2003-01-10 02:59:03 UTC
From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Description of problem: When I use regular expression in grep, it outputs lines which do not contain the specified patterns. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: Just try the following at shell prompt: echo "foo" |grep "[L-Z]" Actual Results: foo Expected Results: nothing should be output Additional info: At first, I thought it was a case-sensitivity problem, but later I found more problems. Note that in the above example, letter 'f' is not even in the list [l- z]. grep is being constantly used by many scripts and programs, and this bug leads to a potential security breach.
Comment 1 Zhao Wu 2003-01-10 03:01:44 UTC
I forgot to mention that this is a new bug in Redhat 8.0. I tried on 7.3 and there is no such a bug.
Comment 2 Tim Waugh 2003-01-10 09:38:18 UTC
You forgot to set LC_COLLATE. See the bash FAQ question E9.
Comment 3 Zhao Wu 2003-01-10 19:38:15 UTC
Thanks for the FAQ info. LC_COLLATE works, but why does "foo" match "[L-Z]" even though 'f' is not in "lLmMnN...zZ"? Isn't that a bug?
Comment 4 Tim Waugh 2003-01-10 22:54:13 UTC
Because 'o' is.