Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: grep replacement Message-ID: <15444@brl-adm.ARPA> Date: 31 May 88 16:57:26 GMT Sender: news@brl-adm.ARPA Lines: 24 From: Bill Wyatt> 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 Well, that *prints* what I want to see, but takes longer than I want to wait. I want it to quit looking in the file. Besides, there is no way you can do `grep -1 pattern *.[ch]' as trivially. Bill UUCP: {husc6,ihnp4,cmcl2,mit-eddie}!harvard!cfa!wyatt Wyatt ARPA: wyatt@cfa.harvard.edu (or) wyatt%cfa@harvard.harvard.edu BITNET: wyatt@cfa2 SPAN: cfairt::wyatt (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 The opinions expressed are solely my own and do not reflect NBS policy or agreement My name is in /usr/dict/words. Is yours?