On Fri, Aug 30, 2013 at 10:50:31AM +0200, Timothy Murphy wrote:The perl one-liner below demonstrates this. Setting the $/ (input record
> that will print out a whole paragraph -
> defined as the section between two blank lines -
> containing a given word or phrase?
>
> Such as the above 4 lines.
> If not, can anyone suggest a simple script that will do this?
separator) var to the empty string causes perl to read in "lines" a
paragraph at a time.
$ perl -e'$/=""; while (<>) { print if /green/ }' /tmp/text