          # File lib/rake.rb, line 1507
    1507:     def egrep(pattern, *options)
    1508:       each do |fn|
    1509:         open(fn, "rb", *options) do |inf|
    1510:           count = 0
    1511:           inf.each do |line|
    1512:             count += 1
    1513:             if pattern.match(line)
    1514:               if block_given?
    1515:                 yield fn, count, line
    1516:               else
    1517:                 puts "#{fn}:#{count}:#{line}"
    1518:               end
    1519:             end
    1520:           end
    1521:         end
    1522:       end
    1523:     end