what should egrep '|root' /etc/passwd print?

Doug Gwyn gwyn at smoke.ARPA
Wed Sep 14 19:55:16 AEST 1988


In article <44414 at beno.seismo.CSS.GOV> rick at seismo.CSS.GOV (Rick Adams) writes:
>What should 
>	egrep '|root' /etc/passwd
>print?

The question of how to handle empty strings in regular expressions
does not have a clear-cut answer.  "sam", which has the most powerful
regular expression mechanism of any of the editor-like programs I use,
says the following:
	?no operand for `|'
which is yet another solution.  (Getting the description right for
where empty strings do and don't match was the hardest task when I
was overhauling sam's manual entry.)



More information about the Comp.unix.wizards mailing list