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.
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.
You forgot to set LC_COLLATE. See the bash FAQ question E9.
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?
Because 'o' is.