With grep I know how to set the context to a fixed number of lines. Is it possible to show a context based on an arbitrary string condition, like set after-context to \"until th
It sounds like you need sed:
sed
sed -n '/pattern/,/^$/p' file
Don't print by default (-n). For lines that match /pattern/ up to an empty line /^$/, print.
-n
/pattern/
/^$/