Why assume that unlikely == impossible? Starting with tye's answer, count the number of newlines in the grep string with the most newlines, buffer that many lines, and use that (+ the current line) to match your pattern.
In reply to Re: Shell Script Woes
by runrig
in thread Shell Script Woes
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |