Skip to content

Instantly share code, notes, and snippets.

@cato
Created March 25, 2011 07:20
Show Gist options
  • Select an option

  • Save cato/886486 to your computer and use it in GitHub Desktop.

Select an option

Save cato/886486 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
q = ARGV[0]
File.open('search.txt', 'r') do |infile|
i = 0
while(line = infile.gets)
i = i + 1
puts "#{i}: #{line}" if line.index(q) != nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment