Is there some one-line way in bash/GNU tools to block until there\'s a string matched in a file? Ideally, with timeout. I want to avoid multi-line loop.
Upda
Thanks both for answers, but the important part was that the process blocks until found, then ends. I found this:
grep -q 'PATTERN' <(tail -f file.log)
-q
is not much portable, but I will only use Red Hat Enterprise Linux so it's ok.
And with timeout:
timeout 180 grep -q 'PATTERN' <(tail -f file.log)