From: James Britt Date: 2005-12-27T14:14:39+09:00 Subject: Re: Found a neat trick for doing recursive one-liners Pat Maddox wrote: > Or you can use the tools designed for finding stuff :) > > find . -name "*.txt" | xargs grep Hello > > That version will work for all files. You can play with find to match > any file you want. Assuming you are on a machine with find, xargs, and grep, as opposed to just Ruby. I like the idea of assembling command line utils that will work on any platform where Ruby is installed (e.g., all the machines in my house). I also like the idea of reinventing the wheel in Ruby because sometimes you get a better wheel. Or at least one that is more hackable. James -- http://www.ruby-doc.org - Ruby Help & Documentation http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys http://www.30secondrule.com - Building Better Tools