I have a file that has a list of filenames- filenames.txt
I have another file that has list of all the files in the system with
their complete filepaths - allfilespath.txt

I want to print the fullpaths of all the files listed in filenames.txt
In shell scripting I would have done somethign like this

for name in filenames.txt
do
  grep $name allfilespath.txt
  if [ $? == 1 ]
  then
    echo $output_from_grep
  fi
done


How do I do this in ruby  ? If possible (again if possible) explain what
the code does. If not I will google and update what each line does.
-- 
Posted via http://www.ruby-forum.com/.