Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!zorch!hico2!kak From: kak@hico2.UUCP (Kris A. Kugel) Newsgroups: comp.sys.3b1 Subject: Re: egrep on the 3b1 is weird! Summary: kak jumped to a conclusion. (but still likely egrep hosed) problem with egrep not as described. Keywords: egrep unix-pc 3b1 Message-ID: <1319@hico2.UUCP> Date: 23 Mar 91 09:07:21 GMT References: <1268@hico2.UUCP> <8783@gollum.twg.com> <1311@hico2.UUCP> Organization: High Country Software Lines: 43 > > In article <1268@hico2.UUCP> kak@hico2.UUCP (Kris A. Kugel) writes: > > >Am I confused, or does egrep on the 3b1 > > >handle multiple regular expressions incorrectly? > > > > > > egrep 'foo|bar' > > > > > >seems to match '[fb][oa][or]' patterns, > > Now, I could see from this [manual] description that maybe the > pattern I tried would match "fo[bo]ar", but that was NOT the > behavior I remember seeing. Well, evidently the problem is not as simple as I described it. I'd used the "foo|bar" example as a substitute phrase for what I was really trying. Bruce Lilly tried this literally with a good sample file, and with this simple case egrep seems to work correctly. And his test works correctly on my machine, too. If I recall correctly, I saw the (I say) incorrect behavior when I trying to find a newsarticle about some subject (I didn't remember the title or group exactly, so I had an "egrep -i "pat1|pat2|pat3|pat4|pat5|pat6|pat7|pat9" kind of thing, probably running on stdin.) I saw the malfunction, looked at a couple of (false match) lines, and thought "these could be explained by . . ." without doing a comprehensive check. It sounds like I'm going to have to find a test case showing this problem exactly, because it's CLEARLY not the straightforward malfunction that I described in my original article. (*sigh* when I get time . . . .) I'd also conclude that I should have been more accurate and complete about the conditions under which I saw the problem, and presented the "[fb][oa][or]" explanation as a hypothesis, rather than as the observed problem. I'll try to be more accurate in the future. Kris A. Kugel ( 908 ) 842-2707 uunet!tsdiag.ccur.com!hico2!kak {daver,ditka,zorch}!hico2!kak internet: kak@hico2.westmark.com