On Fri, Mar 18, 2016 at 9:40 AM Prashant Thorat <thorat.prash...@gmail.com> wrote:
> Hi All, > > Can you please help me to grep below 'block of text' from my file ? this > blocks occurs number of time & I want to grep all in between lines of this > block - > > first line is having - retr_test asm1 > & 4th line is having only - END > > so I want to grep all four lines with above match . > > If you are looking for a command line that works like grep: perl -lne 'print if /retr_test asm1/ .. /END/;' input_file http://perldoc.perl.org/perlop.html#Range-Operators Best Regards, Scott > Thanks in advance, > Prashant > > >