From: Ruby Newbee Date: 2010-01-20T19:01:58+09:00 Subject: Re: help on a script Thanks all. Under all your helps, I finally get the script to work correctly. def myfind(path=".") Dir.foreach(path) do |f| f = File.join(path,f) ## puts f if File.file? f open(f) do |c| puts "#{f}" unless c.read.scan(/ruby/).empty? end elsif File.directory? f and File.basename(f) != "." and File.basename(f) != ".." myfind(f) end end end myfind Thanks. Jenn.