Skip to content

Instantly share code, notes, and snippets.

@jstotz
Created November 7, 2012 17:14
Show Gist options
  • Save jstotz/4033022 to your computer and use it in GitHub Desktop.
Save jstotz/4033022 to your computer and use it in GitHub Desktop.
Terminal prompt after reading $stdin
puts "Reading lines..."
$stdin.each_line do |line|
puts "IN: #{line}"
end
$stdin.reopen File.open("/dev/tty", "r")
puts "Awaiting user input..."
puts "USER INPUT: #{$stdin.gets}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment