[Tutor] Grepping a file for words in a list

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Feb 24 21:23:22 CET 2006



On Fri, 24 Feb 2006, John Purser wrote:

> I'm writing a system admin script in python that checks recently
> accessed files for keywords like "failed, denied, error,..." etc.  I'm
> using popen to call grep -F <LIST> <LOG_FILE> but it's VERY slow.  Can
> anyone suggest a faster method to do this?

Hi John,

This should not be slow, but we have to see what exactly is going on here.
Can you give us more details?  How many keywords are you typically passing
in <LIST>?  How large is the <LOG_FILE>?  What do you mean by "slow"?



More information about the Tutor mailing list