grep replacement

Mario Dorion mdorion at cmtl01.UUCP
Sat Jun 4 00:14:48 AEST 1988


In article <2978 at ihlpe.ATT.COM>, dcon at ihlpe.ATT.COM (452is-Connet) writes:
> In article <6866 at elroy.Jpl.Nasa.Gov> alan at cogswell.Jpl.Nasa.Gov (Alan S. Mazer) writes:
> >
> >One thing I would _love_ is to be able to find the context of what I've
> >found, for example, to find the two (n?) surrounding lines.  I have wanted
> >to do this many times and there is no good way.
> 
> Also, what line number it was found on.
> 
> David Connet
> ihnp4!ihlpe!dcon

Ever tried grep -n ?????

There are three features I would like to see in a grep-like program:

1- Be able to use a newline character in the regular expression
       grep 'this\nthat' file 

2- Be able to grep more than one regular expression with one call. This would
   be faster than issuing many calls since the file would be read only once.

3- To have an option to search only for the first occurence of the pattern.
   Sometimes you KNOW that the pattern is there only once (for example if you
   grep '^Subject:' on news files) and there's just no need to scan the rest of
   the file. When 'grepping' into many files it would return the first occurence
   for each file.

-- 
     Mario Dorion              | ...!{rutgers,uunet,ihnp4}!     
     Frisco Bay Industries     |            philabs!micomvax!cmtl01!mdorion
     Montreal, Canada          |
     1 (514) 738-7300          | I thought this planet was in public domain!



More information about the Comp.unix.wizards mailing list