Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using the following egrep invocation as a filter for an ant build:

egrep '\[.*\]|BUILD|time\:'

The build.xml file has a huge number of empty or unimportant targets that I'm trying to filter out. However, any of them that have "build" in the name are still showing up in the output:

s.properties.build.mode.default:
s.properties.build.mode:
      [jar] Building jar: <my jar path>.jar
      [jar] JARs are never empty, they contain at least a manifest file
build.latest.execute:

(Context: This is on RHEL5.)

Why is this regex matching in a case insensitive manner?

In response to comments:

user@host ~> echo $GREP_OPTIONS

user@host ~> type egrep
egrep is an alias for grep -E
user@host ~> alias egrep
egrep='grep -E'
share|improve this question
    
a shot in the dark, but check your GREP_OPTIONS env variable, see if you have -i in there –  Rich Homolka Feb 28 '12 at 18:35
    
Similarly, check that your egrep isn't somehow aliased to use -i. E.g., type egrep or alias egrep. –  jjlin Feb 28 '12 at 19:15
    
Okay, so your egrep is aliased to grep -E, which is weird in itself, since there's no need for such an alias (as egrep implicitly means grep -E). What is your grep aliased to then? –  jjlin Feb 28 '12 at 20:35
    
That was the problem - grep was aliased to grep -i --color=auto. If you'd care to answer, I'll accept it. –  arootbeer Feb 28 '12 at 20:48
    
Answered, thanks. –  jjlin Feb 28 '12 at 20:55

1 Answer 1

up vote 1 down vote accepted

Check that your grep or egrep isn't aliased to use the -i option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.