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

Rick Adams rick at seismo.CSS.GOV
Wed Sep 14 08:28:05 AEST 1988


What should 
	egrep '|root' /etc/passwd
print? (Presume you have one and only one line containing the string
root in /etc/passwd).

On BSD systems, it prints the single line containing root. On
System 5 systems it prints EVERY line.

Obviously the question is what should the null pattern to
the left of the "|" match. With BSD it matches nothing, with SYS5 it
matches everything.

(That patter was generated by aprogram in case you were wondering
who would ever type something like that)

---rick



More information about the Comp.unix.wizards mailing list