#!/usr/bin/env ruby name = ARGV[0] unless name puts "file path required" exit -1 end matches = [] paths = ENV['ROLL_PATH'].split(/[:;]/) paths.each do |path| matches = Dir.glob(File.join(path,'{*,*/*,*/*/*,*/*/*/*}',name)) # searches up to four layers deep. end matches = matches.select{ |f| File.executable?(f) } matches = matches.sort{ |a,b| File.mtime(b) <=> File.mtime(a) } matches.each do |f| puts "#{File.mtime(f)} #{f}" end