grep replacement

Dan Trottier dan at maccs.UUCP
Tue May 31 23:13:16 AEST 1988


In article <8077 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
>> > There have been times when I wanted a grep that would print out the
>> > first occurrence and then stop.
>> 
>> grep '(your_pattern_here)' | head -1
>
>Doesn't cut it for
>
>	grep '(your_pattern_here)' firstfile secondfile thirdfile ...

This is getting ridiculous and can be taken to just about any level...

	foreach i (file1 file2 ...)
	   grep 'pattern' $i | head -1
	end

-- 
       A.I. - is a three toed sloth!        | ...!uunet!mnetor!maccs!dan
-- Official scrabble players dictionary --  | dan at mcmaster.BITNET



More information about the Comp.unix.wizards mailing list