From: nobuyoshi nakada Date: 2005-12-27T13:21:28+09:00 Subject: Re: Found a neat trick for doing recursive one-liners Hi, At Tue, 27 Dec 2005 12:57:53 +0900, Gary Watson wrote in [ruby-talk:172611]: > I know you can do this in pure ruby in like 3 lines if you use the Find > module, but I really wanted to do it with a one liner. Earlier I tried > something like this > > ruby -ne 'print if /Hello/' `find -name '*.txt'` > > unfortunately that version would fail if there were any spaces in the > filenames. ruby -ne 'BEGIN{ARGV.replace(Dir[ARGV.join("\0")])}; print if /Hello/' '**/*.txt' -- Nobu Nakada