Hi, Thnaks for the reply. I was thinking its something to do with recurse as in ls -ltr, but when I do: grep -r "^[A-Z]" * I get: "Illegal option -- r"?
Any idea why? Regards, Aim ########################################################################################## Dan Muey wrote: > > Hi, > > > > sorry to sound like a novice but what is the -r option for? > > man grep > > -r, --recursive > Read all files under each directory, recursively; > this is equivalent to the -d recurse option. > > > > > ` grep -r "$string" * ` > > > > It does not seem to be listed in my unix refernce book. > > > > regards, Aim. > > > > ############################################################## > > ############################ > > > > Ramprasad wrote: > > > > > James Ferree wrote: > > > > Hi, > > > > > > > > I am looking to write a script that will look in a > > > > file for a list of text strings to search for like > > > > > > > > req_aaaa > > > > req_bbb > > > > req_ccc > > > > > > > > and search all the files in a subdirectory and below > > > > for the string, if it is found, then it prints out the > > > > the original string followed by the file name for each instance > > > > where it is found. If it gets through all the files and > > finds none, > > > > the it prints out the original string and the Words NOT FOUND. > > > > > > > > Thanks for any help, > > > > Jim > > > > > > quiet a simple problem > > > why dont u try the code yourself > > > > > > the algo may run like this > > > write a function to get all filenames with respect to current > > > directory into an array > > > write a function that accepts a filename and returns > > the the lines > > > that match your string > > > foreach of the array run the function and print the output > > > > > > but IMHO doing this in perl does not seem to be the best > > option If you > > > are using unix like system just try getting grep > > > > > > Your entire script is over in just one line ` grep -r "$string" * ` > > > > > > Bye > > > Ram > > > > > > -- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]