F
Franklin Lee
Hi all,
Now I met problem when using Perl Expect.
I want to get the return code for cmd.
For example,
df -k
echo $?
codes as below
****************************************
....
exp->send("echo \$?\r");
exp->expect($timeout, "echo \$?\r\n");
exp->expect($timeout, "([0-9]+)\r\n");
.....
****************************************
But I can't use ([0-9]+ to match 0 or other number?
So could you tell me the reason? or how should I do?
Thank you!
Franklin
Now I met problem when using Perl Expect.
I want to get the return code for cmd.
For example,
df -k
echo $?
codes as below
****************************************
....
exp->send("echo \$?\r");
exp->expect($timeout, "echo \$?\r\n");
exp->expect($timeout, "([0-9]+)\r\n");
.....
****************************************
But I can't use ([0-9]+ to match 0 or other number?
So could you tell me the reason? or how should I do?
Thank you!
Franklin