Skip to content

Instantly share code, notes, and snippets.

@simonjodet
Created December 13, 2011 12:56
Show Gist options
  • Save simonjodet/1472043 to your computer and use it in GitHub Desktop.
Save simonjodet/1472043 to your computer and use it in GitHub Desktop.
Ruby - Execute a shell command
cmd = 'ls'
stdin, stdout, stderr = Open3.popen3(cmd)
stdout = stdout.readlines.to_s
stderr = stderr.readlines.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment