Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created February 20, 2009 21:35
Show Gist options
  • Select an option

  • Save samaaron/67708 to your computer and use it in GitHub Desktop.

Select an option

Save samaaron/67708 to your computer and use it in GitHub Desktop.
#!/bin/zsh
#stored in the file ~/beans
for i in {1..100} ; do ; sleep 2 ; echo 'BEANS BEANS BEANS\n' ; done
require 'open4'
executable_path = "~/beans"
Open4::popen4(executable_path) do |pid, stdin, stdout, stderr|
puts "reading outp"
stdout.sync = true
200.times do
puts "reading..."
out = stdout.read
puts "read"
puts " - standard output: " << out
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment