Skip to content

Instantly share code, notes, and snippets.

@jstorimer
Created December 30, 2011 05:15
Show Gist options
  • Save jstorimer/1538024 to your computer and use it in GitHub Desktop.
Save jstorimer/1538024 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
pattern = ARGV.shift
data = ARGF.read
data.each_line do |line|
exit if line.match(pattern)
end
abort "No matches found"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment