daphnaw has asked for the wisdom of the Perl Monks concerning the following question:
$result returns empty & $status will always return -1. I've tried adding a match pattern for the string printed at th end of the script in case of success, with no success either :my $result = $exp->send("exec dummp.pl\n"); { #Ignoring :: IO::Stty not installed, cannot change mod +e at test.pl line 22 local $SIG{__WARN__} = sub { my $warn = shift; if ($warn !~ /IO::Stty/) { print STDERR $warn; } }; $exp->interact; } $exp->soft_close(); my $status = $exp->exitstatus();
Any ideas? Thanks Daphnamy $resonse = 'Installation finished successfully' ; $exp->expect($timeout, ['-re', $resonse => sub {} ], [ timeout => sub { die "Timeout, no prompt" } ], );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to recieve the exit code of a script executed through Expect ?
by Illuminatus (Curate) on May 05, 2010 at 17:55 UTC | |
by daphnaw (Acolyte) on May 06, 2010 at 09:15 UTC | |
by Illuminatus (Curate) on May 06, 2010 at 13:31 UTC |