Thanks Andrew!
So does the egrep searches within the document itself or? sorry i didn't
understand exactly!
Tahnks again
Nick
----- Original Message -----
From: "Andrew Cilia" <[EMAIL PROTECTED]>
To: "Nicky Formosa" <[EMAIL PROTECTED]>
Sent: Friday, October 08, 2004 5:58 PM
Subject: Re: Search Script
> To get a list of all files ending with ".txt" or ".doc" and that contain
the
> words reports or live in any case mixture, do the following:
>
>
> find . -name *.txt -o -name *.doc -exec egrep -il "reports|live" {} \;
>
> the "-o" is an "or" operator, the egrep command is a multiple grep
"globally
> search fora regular expression and print" and the "." after the find is
the
> directory to start looking from. It looks recursively down all
directories.
> You can limit this via find options.
>
> Cheers
>
> On Friday 08 October 2004 09:58, you wrote:
> > Hi All
> >
> > I would like to ask you if you can help me with this:
> >
> > I need a search script that given certain parameters such as:
> >
> > 1) extension type (multiple)
> > and
> > 2) search text
> >
> > i will go through a certain folder and search within the documents
> > (extension types chosen) for the given search text/(s). The text, such
as
> > 'Reports Live', should be searched for both the word 'Reports' and the
> > word 'Live' seperatly but also together. The result should be a log file
> > with the names of the documents found!
> >
> > Is this possible? What i did is the following:
> >
> > rm search.log
> > touch search.log
> >
> > for i in $1*$2
> > do
> > if cat $i | grep -a $3 ; then
> > echo $i >> search.log
> > fi
> > done
> >
> > Where $1 = the folder searching in
> > $2 = One extension only!
> > $3 = Search text with no OR
> >
> >
> > This works but its not exactly what i want! Are there any Search tools
> > available or?
> >
> > Tahnks
> > Nick
>
> --
> Andrew Cilia B.Sc. MCSE ICSE RHCT
> Software Engineer
> ___________________________________
> Philip Toledo Limited
> Computer & Communications Solutions
> Notabile Road, Mriehel BKR01, Malta
>
> Telephone:+356 21445566
> Mobile: +356 99430588
> Fax: +356 21484316
> Email: [EMAIL PROTECTED]
> Web Site: http://www.ptl.com.mt
>
>