Nakada, Nobuyoshi
12/27/2005 4:21:00 AM
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