Created
October 6, 2009 15:50
-
-
Save mudge/203141 to your computer and use it in GitHub Desktop.
Pipe input into a system command in Ruby.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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