[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Perl Question
- Subject: [ale] Perl Question
- From: kenn at pcintelligent.com (Ken Nagorski)
- Date: Mon, 16 Oct 2000 15:33:31 -0400 (EDT)
Actully neither of those work, but DUH, grep -2 $pattern file from the
shell did it, you see egrep doesn't repeat lines so it works even if there
is a match only one ilne below.
Ken
On Mon, 16 Oct 2000, Danny Cox wrote:
> Ken,
>
> On Mon, 16 Oct 2000, Danny Cox wrote:
> > > I have a little perl problem, lets say I have a grep and it returns true.
> > > I want to not only print that line but I wanna print the line
> > > below. Anyone know how I noght do this?
> >
> > See the '-A' option to grep (at least, GNU grep).
> >
> > grep -A1 'pattern' file
> >
> > will do what you wish.
>
> Whups! I missed the 'perl' part. Well, you could use the system()
> function in the same way.
>
> Danny
>
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
>
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.