Xref: utzoo comp.unix.wizards:9190 comp.unix.questions:7488 Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!mtunx!pacbell!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!pyramid!prls!philabs!micomvax!cmtl01!m From: mdorion@cmtl01.UUCP (Mario Dorion) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Message-ID: <316@cmtl01.UUCP> Date: 3 Jun 88 14:14:48 GMT Article-I.D.: cmtl01.316 References: <7882@alice.UUCP> <5630@umn-cs.cs.umn.edu> <6866@elroy.Jpl.Nasa.Gov> <2978@ihlpe.ATT.COM> Organization: Frisco Bay Industries, Montreal Lines: 33 In article <2978@ihlpe.ATT.COM>, dcon@ihlpe.ATT.COM (452is-Connet) writes: > In article <6866@elroy.Jpl.Nasa.Gov> alan@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!