in reply to How to recieve the exit code of a script executed through Expect ?
Perhaps there is a better way, but the only thing that comes to mind is to wrap your called script inside a shell script, which then prints the exit status. You can then use $exp->expect to look at it wrapper.sh:
modified example:#! /bin/bash dummp.pl # may need full/relative path here echo $?
my $result = $exp->send("exec wrapper.sh"); $exp->expect (5, [qr/1/, sub {<handle failure>}], [qr/0/, sub {<handle success>}], ...); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to recieve the exit code of a script executed through Expect ?
by daphnaw (Acolyte) on May 06, 2010 at 09:15 UTC | |
by Illuminatus (Curate) on May 06, 2010 at 13:31 UTC |