Skip to content

Instantly share code, notes, and snippets.

@gelias
Created March 23, 2016 20:34
Show Gist options
  • Select an option

  • Save gelias/e75d7ce135114c52f918 to your computer and use it in GitHub Desktop.

Select an option

Save gelias/e75d7ce135114c52f918 to your computer and use it in GitHub Desktop.
#!/bin/ruby
full_filename = ARGV[0]
text_to_search = ARGV[1]
fileObj = File.new(full_filename, "r")
while (line = fileObj.gets)
if line.include? text_to_search
puts(line)
end
end
fileObj.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment