Problem manipulating text using grep
- by moata_u
I want to search for a line that contains log4j and take 7 lines before and 3 lines after the match.
grep -B7 -A3 "log4j" web.xml
After that I want to add comment tags before this paragraph and after it.
<!--
paragraph that i found by grep
-->
I wrote this script bellow:
search=`find . -name 'web.xml'`
text=`grep -B7 -A3 "log4j"…