Xref: utzoo comp.unix.wizards:9414 comp.unix.questions:7620 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!osu-cis!killer!tness7!bellcore!faline!thumper!ulysses!andante!alice!andrew From: andrew@alice.UUCP Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Tool -flag considered harmful Summary: clarification of -[1sl] for grep Message-ID: <7986@alice.UUCP> Date: 15 Jun 88 17:56:44 GMT Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 13 the following clarification may be well known to some but i have received sufficent enquiries to warrant an explanation. firstly, -1 and -l involve exactly the same amount of work. the only difference is that in the latter, the filename is printed and in the former, the line is printed. In both cases, getting a hit stops the processing for that file. -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.