Xref: utzoo comp.unix.wizards:9390 comp.unix.questions:7604 Path: utzoo!attcan!uunet!steinmetz!vdsvax!barnett From: barnett@vdsvax.steinmetz.ge.com (Bruce G. Barnett) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Message-ID: <4627@vdsvax.steinmetz.ge.com> Date: 15 Jun 88 13:44:44 GMT References: <7962@alice.UUCP> Reply-To: barnett@steinmetz.ge.com (Bruce G. Barnett) Organization: General Electric CRD, Schenectady, NY Lines: 30 In article <7962@alice.UUCP> andrew@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 uunet!steinmetz!barnett