new grep

Mohamed Ellozy mohamed at hscfvax.harvard.edu
Tue Jun 21 22:20:18 AEST 1988


In article <16237 at brl-adm.ARPA> williams at nrl-css.arpa writes:
>	        Al Aho and I are designing a replacement for grep, egrep
>		and fgrep.  The question is what flags should it support and
>		what kind of patterns ...
>	 
>	I have always thought it would be nice to print only the first match.
>	
>	        (Root Boy) Jim Cottrell <rbj at icst-cmr.arpa>
>
>I'll second this.  There have been many times when I simply wanted to
>detect the presence of a pattern in a file, then stop searching.  Combining
>this with the -n option can also be useful.

Also times when I am searching for something that is close to the start
of a long file (e. g. a host that is close to the start of /etc/hosts).
I can save time by doing a head -NNN | grep, but I must guess a suitable
value for NNN, while a grep that quits after the first match does it for
me.



More information about the Comp.unix.wizards mailing list