in reply to Recursively grep through directory trees.

Pretty good snippet. One thing: you should use while instead of foreach. From the Camel book:
In a foreach statement, the expression in parenthesis is evaluated to produce a list.
So when you use foreach(<FILE>) you are slurping the entire file in memory before looping through the files. while on the other hand, would read the file one line at a time, which is good for your purposes.

--ZZamboni

  • Comment on RE: Recursively grep through directory trees.