Skip to content

Instantly share code, notes, and snippets.

require 'open3'
#basic shell command
def run_command(current_command)
Open3.popen2e(current_command) {|stdin, stdout, wait_thr|
pid = wait_thr.pid # pid of the started process.
puts pid
stdout.each do |line| log line end