Xref: utzoo comp.unix.wizards:9430 comp.unix.questions:7631 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: Tool -flag considered harmful Message-ID: <4630@vdsvax.steinmetz.ge.com> Date: 16 Jun 88 15:30:41 GMT References: <7986@alice.UUCP> Reply-To: barnett@steinmetz.ge.com (Bruce G. Barnett) Organization: General Electric CRD, Schenectady, NY Lines: 25 In article <7986@alice.UUCP> andrew@alice.UUCP writes: |-s is potentially faster in that after we get a hit, all we have to do is |try opening the remaining file arguments (in case we have to return a 2 for |inaccessible file arguments). in practise, no one bothers to write this -------- |separate loop and they use the same code as -l. This seems to be a major loss in efficiency. While grep -s Subject /usr/spool/news/comp/sources/unix/* might not be painful, something like grep -s 'Archive-name: program/part01' /usr/spool/news/comp/sources/unix/* would be. If indeed -s used the same code as -l, then grep would still read EVERY LINE OF EVERY FILE - except for the single file that had the string being searched for. I really don't see any justification for the waste of CPU cycles. -- Bruce G. Barnett uunet!steinmetz!barnett