Skip to content

Instantly share code, notes, and snippets.

@twosevenzero
Created August 10, 2015 18:00
Show Gist options
  • Save twosevenzero/1e54c938898609f948a9 to your computer and use it in GitHub Desktop.
Save twosevenzero/1e54c938898609f948a9 to your computer and use it in GitHub Desktop.
tsz:Desktop $ cat test
this
is
a
bunch
of
invalid
text
for
you
to
read
and
love
thanks
tsz:Desktop $ cat test.rb
#!/usr/bin/env ruby
IO.foreach("test") do | word |
print "\rTrying: #{word}"
if word.include? "love"
puts "[+] Success: #{word}"
break
end
end
tsz:Desktop $ ./test.rb
Trying: this
Trying: is
Trying: a
Trying: bunch
Trying: of
Trying: invalid
Trying: text
Trying: for
Trying: you
Trying: to
Trying: read
Trying: and
Trying: love
[+] Success: love
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment