Hello all,
In my current project I need to extract a section of text from the bottom of a file till a pattern is match, for example,
cat data
Code:
old old data
old data
From: abc@domain.com
something else
more text
...
From: def@domain.net
some data
more data
...
I need to extract the text beginning with def@domain.net (the From line will be used as ending pattern and it can be any email address). What I came up with so far is:
tac data | sed '/From.*@.*/q' | tac
This works well and meets my need but I wonder if there are other (more elegant) solutions to this problem.

Thanks for helping.