Quote:
Originally Posted by angel115
I'm trying to match a pattern spreadout on multyple line. (without success until now)
Ex: "test.txt"
Code:
The cat
in the street
Look nice
I want to be able to match
"The cat
in the street"
for example
|
I was searching for multiline grep when I came across this thread, so I thought I'd drop off my solution:
(Assuming bash)
Code:
while read line; do echo "$line" | grep "The cat"; echo "$line" | grep "in the street"; done < test.txt
(The awk solution is a lot cleaner, however, but this is a way to use just grep)