Re: grep prolem

From: Heiner Steven (heiner.steven_at_nexgo.de)
Date: 10/20/03


Date: Mon, 20 Oct 2003 23:55:33 +0200

Eric Moors wrote:

>>In the above lines i want to pick up the lines whereever 'DISK FILE'
>>starts and upto
>>the point 'END OF SEARCH'.
>>All the lines comes in the DISK FILE' and 'END OF SEARCH' keywords ?
>
> I know you asked for grep, but sed is just perfect for this:
>
> sed '/DISK FILE/,/END OF SEARCH/!d' xyz

and the almost identical AWK solution looks like this:

    awk '/DISK FILE/,/END OF SEARCH/' xyz

Heiner

-- 
 ___ _
/ __| |_ _____ _____ _ _     Heiner STEVEN <heiner.steven@nexgo.de>
\__ \  _/ -_) V / -_) ' \    Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_|   http://www.shelldorado.com/