I use IO.popen to execute a command and capture output as follows:
process = IO.popen("sudo -u service_user -i start_service.sh") do |io| while line = io.gets line.chomp! process_log_line(line) end end
How can I capture the exit status * start_service.sh *?
ruby
Jordan Dea-Mattson
source share