grep replacement

Bruce G. Barnett barnett at vdsvax.steinmetz.ge.com
Wed Jun 15 23:44:44 AEST 1988


In article <7962 at alice.UUCP> andrew at alice.UUCP writes:
|
|	The following is a summary of the somewhat plausible ideas
|suggested for the new grep. 

|4) print one(first matching) line and go onto the next file.
|	most of the justification for this seemed to be scanning
|	mail and/or netnews articles for the subject line; neither
|	of which gets any sympathy from me. but it is easy to do
|	and doesn't add an option; we add a new option (say -1)
|	and remove -s. -1 is just like -s except it prints the matching line.
|	then the old grep -s pattern is now grep -1 pattern > /dev/null
|	and within epsilon of being as efficent.
	                            -----------
Actually this is extremely wrong.

Given the command 
	grep -1 Subject /usr/spool/news/comp/sources/unix/* >/dev/null
and
	grep -s Subject /usr/spool/news/comp/sources/unix/* >/dev/null

I would expect the first one to read *every* file. 

The second case ( -s ) should terminate as soon as it finds the first
match in the first file.

Unless I misunderstand the functionality of the -s command.
-- 
	Bruce G. Barnett 	<barnett at ge-crd.ARPA> <barnett at steinmetz.UUCP>
				uunet!steinmetz!barnett



More information about the Comp.unix.wizards mailing list