grep replacement

Ian Donaldson rcodi at yabbie.rmit.oz
Mon May 30 14:08:10 AEST 1988


>From article <3324 at phri.UUCP>, by roy at phri.UUCP (Roy Smith):
> It would certainly speed up things like
> 
> 	grep "^Subject: " /usr/spool/news/comp/sources/unix/*

> where I know that the pattern is going to be matched in the first few lines
> and don't want to bother searching the rest of the multi-killoline file.

A simple permutation:

 	head -60 /usr/spool/news/comp/sources/unix/* | grep "^Subject: "

works fairly close to the mark, and doesn't waste much time at all.

Ian D



More information about the Comp.unix.wizards mailing list