Skip to content

Instantly share code, notes, and snippets.

@toretore
Last active Aug 29, 2015
Embed
What would you like to do?
require 'open3'
Open3.popen3 'bash' do |stdin, stdout, stderr, wait|
t=Thread.new{ stdout.each{|l| print l } }
stdin.puts 'ls'
stdin.puts 'exit'
wait.join
t.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment