Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Finding words in paragraphs Message-ID: <10545@smoke.BRL.MIL> Date: 17 Jul 89 18:00:53 GMT References: <8421@batcomputer.tn.cornell.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 17 In article <8421@batcomputer.tn.cornell.edu> lacey@tcgould.tn.cornell.edu (John Lacey) writes: >Awk is what you want in this case. Try something like this: > awk 'BEGIN { FS = ""; RS = "\n"} /the-word-here/' the-filename-here $ awk 'BEGIN { FS = ""; RS = "\n"} /test/' > foo This isn't it. Try again. The requirement is to print the whole paragraph. This is a test. End of paragraph. Done. ^D $ cat foo This is a test. $