bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "grep"


From: Stepan Kasal
Subject: Re: "grep"
Date: Tue, 1 Oct 2002 10:45:17 +0200
User-agent: Mutt/1.2.5.1i

Hello,

On Mon, Sep 30, 2002 at 09:44:15PM -0700, address@hidden wrote:
> The GNU grep program does not apear to have the "-p" option that you can
> use with grep under AIX.
> 
> The "-p"  option allows you to grep entire paragraghs from a file with
> the seperator being a blank line.  I have many scripts that were written
> under AIX that take advantage of this.
> 
> Is there a way to accomplish the same thing with GNU "grep"?

I don't know how could this be done by grep but there is a solution
involving awk.  Try this:

awk 'BEGIN{RS=""};/abc/' inputfile

If this doesn't fit your needs, feel free to mail me personally.
You may also discuss this solution in comp.lang.awk, until you get
a suitable replacement for "grep -p".

Have a nice day,
        Stepan Kasal





reply via email to

[Prev in Thread] Current Thread [Next in Thread]