Skip to content

Instantly share code, notes, and snippets.

@mapfel
Created April 15, 2013 20:40
Show Gist options
  • Save mapfel/5391123 to your computer and use it in GitHub Desktop.
Save mapfel/5391123 to your computer and use it in GitHub Desktop.
Ruby - day 2: little grep program
counter = 1
file = File.new($0, "r")
while (line = file.gets)
if line.include?("line")
puts "#{counter}: #{line}"
end
counter += 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment