I know that by using the
"-A NUM" switch I can print specific number of trailing lines after each match. I am just wondering if it's possible to print trailing lines until a specific word is found after each match. e.g. When I search for "Word A" I want to see the line containing "Word A" and also the lines after it until the one containing "Word D".
Word A Word B Word C Word D Word E Word F
grep -A10 'Word A'
I need this output:
Word A Word B Word C Word D