How to get exit status with Ruby’s Net::SSH library?
I find the following way of running processes with Net::SSH much more useful. It provides you with distinct stdout and stderr, exit code and exit signal. require ‘rubygems’ require ‘net/ssh’ require ‘etc’ server=”localhost” def ssh_exec!(ssh, command) stdout_data = “” stderr_data = “” exit_code = nil exit_signal = nil ssh.open_channel do |channel| channel.exec(command) do |ch, success| … Read more