Skip to content

Instantly share code, notes, and snippets.

@sowawa
Created February 2, 2012 20:46
Show Gist options
  • Save sowawa/1725660 to your computer and use it in GitHub Desktop.
Save sowawa/1725660 to your computer and use it in GitHub Desktop.
get cmd output by ruby.
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
@keikubo
Copy link

keikubo commented Mar 28, 2012

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment