Hello,
I'm trying to manage a ssh connection to a network device via the PTY module, with a code similar to this :
cmd_line = "ssh [email protected]"
begin
PTY.spawn(cmd_line) do |r_f,w_f,pid|
...
rescue PTY::ChildExited => cended
...
end
The whole i/o works pretty well, however I don't know how to get the exit status of the child process !
For instance if the connection is broken or simply times out, the spawned process will terminate (with an error code) but this code does not seem to be returned in the $? special variable.
If you have any ideas on how to get the spawned process return code, I'd really appreciate !
Regards,
_dl