Insert this line and the solution will reveal before your weary eyes...
Hint: You need to escape $?.print "$command ; echo COMMAND_RET:$? | sed 's/^/COMMAND_OUT: /g'; ech +o -n END_; echo EXPECT\n";
Why not get rid of the sed-invocation?
Depending on the shells flavour of echo, you could also get rid of the second echo invocation.$exp->send("$command ; echo 'COMMAND_OUT: COMMAND_RET:'\$?; echo END_E +XPECT\n");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Incorrect value 0 reported in command execution return value variable $?, when trying with expect->send command
by Davewhite (Acolyte) on Feb 27, 2012 at 07:14 UTC |
In Section
Seekers of Perl Wisdom