From: Devin Mullins Date: 2006-01-05T14:14:55+09:00 Subject: Re: Searching a file for keywords? Joel VanderWerf wrote: >puts IO.read('/proc/partitions').grep(/hda/) puts open('/proc/partions/){|f|f.grep /hda/} Same number of characters, and much better memory usage for big files, I'd imagine. Devin >Ross Bamford wrote: > > >> File.open('/proc/partitions') do |f| >> puts f.grep(/hda/) >> end >> >>