Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.bugs.4bsd,comp.bugs.sys5 Subject: egrep botch Message-ID: <8759@utzoo.UUCP> Date: Tue, 13-Oct-87 13:35:01 EDT Article-I.D.: utzoo.8759 Posted: Tue Oct 13 13:35:01 1987 Date-Received: Tue, 13-Oct-87 13:35:01 EDT Organization: U of Toronto Zoology Lines: 21 The following bug appears to be present in egrep (the Bell/AT&T one, not the comp.sources.unix one) on all extant versions of Unix. Certainly it is present in V7, 4.2BSD, Sunnix 3.2, and 386 System V Release 3. % echo 0 >foo % egrep '0.' foo % egrep '^0.' foo 0 % Adding the "^" seems to convince egrep that "." can legitimately match newline. Changing "." to "[^x]" does not change the behavior. Some quick tests suggest that "$" does not produce a similar anomaly. I can find no statement in any manual that gives even a shred of legitimacy to this. Unfortunately, I lack the time to root around in the somewhat obscure innards of egrep to discover the exact cause and fix. Anybody out there feeling ambitious? :-) -- "Mir" means "peace", as in | Henry Spencer @ U of Toronto Zoology "the war is over; we've won". | {allegra,ihnp4,decvax,utai}!utzoo!henry