Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • What do you mean by This is done in an infinite loop on a stream of text? Are you saying that you're running one grep per line of text? Where is the text coming from? Would tail -f be an option? Commented Sep 11, 2017 at 10:39
  • Let's say I'm accumilating the stream for 30 seconds and then run grep on that chunk. Commented Sep 11, 2017 at 10:41
  • 1
    It's still not clear why you'd need to run grep several times. Possibly related: Why is matching 1250 strings against 90k patterns so slow? Commented Sep 11, 2017 at 10:43
  • 5
    grep is meant to work on a stream of text, I still don't get why you'd need to run several instances. Why can't you feed all those to the same grep instance? Why do you need to accumulate them before feeding to grep? Commented Sep 11, 2017 at 11:05
  • 2
    Take a look at flex, and write your own program, that may turn out to be much faster. Commented Sep 11, 2017 at 13:45