Created
February 2, 2012 20:46
-
-
Save sowawa/1725660 to your computer and use it in GitHub Desktop.
get cmd output by 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
module CMDUtils | |
def get_cmd_output cmd | |
output = '' | |
IO.popen( | |
cmd | |
) do |io| | |
output = io.read() | |
end | |
output | |
end | |
module_function :get_cmd_output | |
end |
thanks!
Great!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The usage is