1833653 Members
3812 Online
110062 Solutions
New Discussion

egrep question

 
Steve Edmunds_2
New Member

egrep question

Is this a bug with /usr/bin/egrep?

#echo aaa> a1.txt; echo "DR(aaa)" > b1.txt
#/usr/bin/egrep -w -f a1.txt b1.txt
#
Whereas:
# /opt/gnu/bin/egrep -w -f a1.txt b1.txt
DR(aaa)

as expected...
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: egrep question

A careful reading of the egrep man page (pay attention to the -w option) indicates that HP
got it wrong. Because the "()"'s are non word-constituent characters. I wouldn't trust quirks of egrep anyway and explicitly use a regular expression as a safer test.
If it ain't broke, I can fix that.
Steve Edmunds_2
New Member

Re: egrep question

Thanks, that does answer my question.