tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Upper and Lower case in SED??

'eval' question ▻

How to display a paragraph instead of a line with grep?

In article <94E83FCCE404D111A9040060B058ABF27BB220@DCTMAIL>,
Lawrence Juliussen  <ljuliussen@dcthomson.co.uk> wrote:
>Could someone show me how to display the full paragraph containing a
>word found by grep rather than just the single line. If it's possible.

This is easy in Perl.  To print every paragraph in `file' that contains
the string `pattern', use this.

    perl -n000e 'print if /pattern/' file

Tim.
--
Tim Goodwin   | "You don't need to do drugs in order to
University of | think that the government's policies are
Leicester, UK | stupid and dangerous." -- David Bancroft

Original headers:

From: tjg@ltpcg.star.le.ac.uk (Tim J Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: How to display a paragraph instead of a line with grep?
Date: 12 Jul 1999 14:56:46 +0100
Organization: University of Leicester, UK
Message-ID: <7mcs7k$t08$1@ltpcg.star.le.ac.uk>
References: <94E83FCCE404D111A9040060B058ABF27BB220@DCTMAIL>

△ comp.unix.shell △

◅ Upper and Lower case in SED??

'eval' question ▻