Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created February 25, 2009 20:10
Show Gist options
  • Select an option

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

Select an option

Save samaaron/70385 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'open4'
cmd = 'echo hello'
Open4::popen4(cmd) do |pid, stdin, stdout, stderr|
puts stdout.gets
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment