In the original script you see that in the line corresponding to $exp->expect($timeout, 're', "$user\@cli>"); the 're' is actually '-re'. It is also '-re' in the documentation. '-re' is a parameter to tell Expect to use the following exit patterns as regexes instead of just as search strings. 're' is interpreted just as another exit pattern and since there is a 're' in 'Unconfigu<re>d', Expect stops there
Just remove the 're' and it should work
In reply to Re: Struggling to collect o/p of command using expect.
by jethro
in thread Struggling to collect o/p of command using expect.
by dannyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |