Xref: utzoo comp.unix.wizards:9050 comp.unix.questions:7358 Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!cbmvax!uunet!sco!brianm From: brianm@sco.COM (Brian Moffet) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Summary: Use SED Possibly? Message-ID: <595@viscous> Date: 1 Jun 88 15:54:53 GMT References: <7882@alice.UUCP> <5630@umn-cs.cs.umn.edu> <6866@elroy.Jpl.Nasa.Gov> <4524@vdsvax.steinmetz.ge.com> <1036@cfa.cfa.harvard.EDU> Reply-To: brianm@sco.COM (Brian Moffet) Organization: The Santa Cruz Operation, Inc. Lines: 20 In article <4537@vdsvax.steinmetz.ge.com> barnett@vdsvax.steinmetz.ge.com (Bruce G. Barnett) writes: >In article <1036@cfa.cfa.harvard.EDU> wyatt@cfa.harvard.EDU (Bill Wyatt) writes: >|grep '(your_pattern_here)' | head -1 > >Or there are times when I want the first occurrence of a pattern from >hundreds of files, but I don't want to see the pattern more than once. > Have you tried sed? How about $ sed -n '/pattern/p;/pattern/q' file ??? -- Brian Moffet brianm@sco.com {uunet,decvax!microsof}!sco!brianm The opinions expressed are not quite clear and have no relation to my employer. 'Evil Geniuses for a Better Tommorrow!'