Finding words in paragraphs

John Lacey lacey at batcomputer.tn.cornell.edu
Tue Jul 18 06:30:14 AEST 1989


In article <10545 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <8421 at batcomputer.tn.cornell.edu> lacey at 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
>
> [A nice demonstration that this doesn't work.]

Yes, I mistyped the line.  It should be { FS = "\n"; RS = "" }.  I _did_
say "something like this" :-).

But, hey, Doug, why didn't you just post a fix to this? [ :-) ]  It's a 
simple typo, and you took the time to test it and post a demonstration
that it didn't work.  Anyhows, switching the values of the field and
record separators will fix this "code" right up.  Bythe, the default
values for Awk are FS = " ", and RS = "\n".

Cheers,

-- 
John Lacey           |  Internet:  lacey at tcgould.tn.cornell.edu
running unattached   |  BITnet:    lacey at crnlthry
                     |  UUCP:      cornell!batcomputer!lacey
"Whereof one cannot speak, thereof one must remain silent."  ---Wittgenstein



More information about the Comp.unix.questions mailing list