Skip to content

Instantly share code, notes, and snippets.

@gbpereira
Created November 30, 2017 18:42
Show Gist options
  • Save gbpereira/f48daf5f97928752121c61ec4674a847 to your computer and use it in GitHub Desktop.
Save gbpereira/f48daf5f97928752121c61ec4674a847 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'find'
dir = ARGV[0]
input = File.open(ARGV[1]).read
# output = File.new((ARGV[2] || 'output'), 'w+')
# puts "searching for #{input.lines.count} files starting at #{dir}"
input.each_line do |filename|
# puts '*'
Find.find(dir) do |path|
if path.match(filename.gsub("\n", ''))
# output.puts(path)
puts path
end
end
end
# puts "output: #{output.path}"
# output.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment