in reply to how to get back a exit status using Net::Telnet
Regarding Net::Telnet, a command executed on the remote side will return its output lines (from the Net::Telnet manpage):$ftp->cwd("/pub") or die "Cannot change working directory ", $ftp->message;
If your script on the remote side prints messages when it encounters an error, just check if @lines matches this pattern. Additionally, you could add echo $? to have the remote side print the exit code of the remote command/script right after it's done:@lines = $t->cmd("who");
Then grep for /status=\d+/ in @lines.@lines = $t->cmd('who; echo status=$?');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to get back a exit status using Net::Telnet
by fraterm (Scribe) on Jan 18, 2005 at 02:50 UTC | |
|
Re^2: how to get back a exit status using Net::Telnet
by Eyck (Priest) on Jan 18, 2005 at 11:41 UTC |