Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!nrl-cmf!cmcl2!rutgers!bellcore!faline!thumper!ulysses!andante!alice!andrew From: andrew@alice.UUCP (Andrew Hume) Newsgroups: comp.unix.wizards Subject: Re: what should egrep '|root' /etc/passwd print? Summary: why it is. Message-ID: <8202@alice.UUCP> Date: 15 Sep 88 05:47:28 GMT References: <44414@beno.seismo.CSS.GOV> <68203@sun.uucp> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 15 it is true that youhave to think carefully about null regular expressions. i (and gre) believe as sam does, '|root' is a syntax error as | is dyadic. the behaviour of matching every line is just wrong. egrep handles this as a special case; recall that egrep takes \n as a synonym for |. aho wanted to forgive the user for being sloppy with quotes and blank lines as in egrep ' abc def ' file which ordinarily has superfluous \n at the beginning and end. i agree that this is a flimsy aim but that is the current practice with egrep. i think that it is clear that grep '' file is always a syntax error; there is no useful interpretation of such a regular expression.