Jeff Pang wrote:
2008/10/26 Brian <[EMAIL PROTECTED]>:
Hello
I would like to do a recursive search of directories and files, checking to
see if a file contains a certain string.
<STDIN> will be a string containing whitespace(s).
As soon as I hit enter, I would like dummy.txt to be time stamped and again
at termination.
I'm playing about with 9.85GB (2.57 million files).

If possible, full pathnames of the files containing the string to go to
dummy.txt

use a "find" command simply:

find /path -type f -exec grep -H "string" {} \;



Tried this different ways, all come out with closely the same error messages.

With no kbd input, if I change your line to ..
find /test -type f -exec grep -H "fred bloggs" {} \;

error message is :-
String found where operator expected at test.pl line 2, near "H "fred bloggs""
        (Do you need to predeclare H?)
Not enough arguments for grep at test.pl line 2, near "H "fred bloggs""
syntax error at test.pl line 2, near "H "fred bloggs"

thanks
Brian


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to