regex command line linux - select all lines between two strings -



regex command line linux - select all lines between two strings -

i have text file contents this:

here super text: text should selected cool match , how ends blah blah...

i trying 2 lines (but more or less lines) between:

some super text:

and

and how

i using grep on ubuntu machine , lot of patterns i've found seem specific different kinds of regex engines.

so should end this:

grep "my regex goes here" myfilenamehere

not sure if egrep needed, utilize easy.

i don't see how done in grep. using awk:

awk '/^and how/ {p=0}; p; /some super text:$/ {p=1}' file

regex linux grep

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -