[Tutor] Grepping a file for words in a list

John Purser jmpurser at gmail.com
Fri Feb 24 21:54:43 CET 2006


On Fri, 24 Feb 2006 12:23:22 -0800 (PST)
Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:

> 
> 
> 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"?
> 


-- 
What good is an obscenity trial except to popularize literature?
		-- Nero Wolfe, "The League of Frightened Men"

Danny, 

"what exactly is going on" is that I'm a doofus who will spend hours
figuring out exactly what command string will get grep to work but then
won't bother to put it in his code!!!

DOH!!!

John


More information about the Tutor mailing list