Skip to content

Instantly share code, notes, and snippets.

@mudge
Created October 6, 2009 15:50
Show Gist options
  • Save mudge/203141 to your computer and use it in GitHub Desktop.
Save mudge/203141 to your computer and use it in GitHub Desktop.
Pipe input into a system command in Ruby.
result = IO.popen(command, 'r+') do |io|
io.write(input)
io.close_write
io.read
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment