From 43fcaa14840a18a4ab9e6ab9530933a6c60bd604 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Tue, 5 Jul 2016 11:30:02 +0200 Subject: ruby/proc-in-out-in-out.rb --- ruby/proc-in-out-in-out.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 ruby/proc-in-out-in-out.rb diff --git a/ruby/proc-in-out-in-out.rb b/ruby/proc-in-out-in-out.rb new file mode 100755 index 0000000..645d620 --- /dev/null +++ b/ruby/proc-in-out-in-out.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +require 'expect' +require 'open3' + +Open3.popen3("/bin/bash") do + | input, output, error, wait_thr | + input.sync = true + output.sync = true + + input.puts "ls /tmp" + puts output.expect("\n", 5) + + input.puts "ls /etc" + puts output.expect("\n", 5) +end + -- cgit v1.2.3