RE: Interpreter failure



If you're looking for a fixed string, then fgrep is normally much faster
than egrep.

	egrep -F 

or 

	egrep --fixed-strings is the same as fgrep.

You can also do

	fgrep -r keyword .

If you want to only look in say .ini files then you'll need to do something
like the following:

	find . -name "*.ini" -exec fgrep keyword '{}' ';' -print

Note the above prints the name of the file AFTER the strings that were found
in the file.

In the example 

	egrep -r "keyword" *

The quotes are mostly optional. If you have embedded spaces then double
quoate can be used. If you have embedded special characters, like $ then
single quotes should be used. If you just want to do something that works
all the time, use single quotes.

When you pass in '*', the shell expands the '*' to the list of all of the
files in the current directory.

egrep never sees the '*', which is why

	egrep -r keyword *.ini

will NOT search directories, unless they happen to have .ini at the end of
the directory name.

Dave Hylands

> -----Original Message-----
> From: emc-at-michael.mailshell.com [emc-at-michael.mailshell.com]
> Sent: Tuesday, June 11, 2002 10:00 AM
> To: Multiple recipients of list
> Subject: Re: Interpreter failure
> 
> 
> 
> 
> 
> >From xfesty <xfesty-at-computeraddictions.com.au>:
> 
> > I'm not sure what your problem is, but you mentioned grep'ing -:
> > 
> > Try "egrep" - it can look through multiple files.
> > 
> > egrep -r "keyword" *
> 
> >From man grep: In addition, two variant programs egrep and 
> fgrep are available.  Egrep is the same as grep -E.  Fgrep is 
> the same as grep -F.
> 
> The * will match multiple files, and the -r will recurse into 
> subdirectories.
> 
> Michael Bushey
> 
> 




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact