Xref: utzoo comp.unix.wizards:9170 comp.unix.questions:7471 Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!pacbell!ames!mailrus!husc6!cca!mirror!adelie!axiom!linus!raybed2!cvbnet2!aperez From: aperez@cvbnet2.UUCP (Arturo Perez Ext.) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Message-ID: <133@cvbnet2.UUCP> Date: 27 May 88 16:53:38 GMT Article-I.D.: cvbnet2.133 References: <662@fxgrp.UUCP> Sender: postnews@cvbnet2.UUCP Lines: 31 From article <662@fxgrp.UUCP>, by ljz@fxgrp.UUCP (Lloyd Zusman): > In article <5630@umn-cs.cs.umn.edu> papowell@attila.UUCP (Patrick Powell) writes: > In article <7882@alice.UUCP> andrew@alice.UUCP 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 > >should it handle? ... Actually, I agree with the guy who posted a request shortly before this came out. The most useful feature that is currently lacking is the ability to do context greps, i.e. greps with a window. There are two ways this could be handled. One is to allow awk-like constructs specifying beginning and ending points for a window. Sort of like, e.g. grep -w '/:/,/^$/' file which would find the lines between each pair of a ':' containing line and the next following blank line. The other way would be to have a simple "number of lines around match" parameter, possibly with collapse of overlapping windows. Then you could say grep -w 5 foo file which would print 2 lines above and below the matching line. Either way it's done would be nice. I have made one attempt to implement this with a script and it wasn't too much fun... Arturo Perez ComputerVision, a division of Prime