<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
<p><font size="2">hi<br>
<br>
I have to retrieve a configuration AVAYA P330<br>
I'm stuck at the end of my script.<br>
manually, I have to press enter to retrieve the prompt and I can
not find the piece of code that I miss.<br>
can someone help me, thank you very much<br>
<br>
CLOGIN SCRIPT<br>
# Run commands given on the command line.<br>
proc run_commands { prompt command } {<br>
global in_proc<br>
set in_proc 1<br>
log_user 1<br>
send "\r"<br>
expect -re $prompt {}<br>
<br>
set commands [split $command \;]<br>
set num_commands [llength $commands]<br>
for {set i 0} {$i < $num_commands} { incr i} {<br>
send -- "[subst [lindex $commands $i]]\r"<br>
<br>
expect {<br>
-re "\[\n\r\]" {exp_continue }<br>
-gl "--type q to quit or space key to
continue--" { send "\r\n" ; exp_continue }<br>
}<br>
}<br>
</font><span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="color: rgb(102, 0, 102);
font-family: Verdana,Arial,Helvetica; font-size: small;"> send
"quit\r"<span class="Apple-converted-space"> </span><br>
expect {<span class="Apple-converted-space"> </span><br>
"\n" {
exp_continue }<span class="Apple-converted-space"> </span><br>
timeout { catch
{close}; catch {wait};<span class="Apple-converted-space"> </span><br>
return 0<span
class="Apple-converted-space"> </span><br>
}<span
class="Apple-converted-space"> </span><br>
eof { return 0 }<span
class="Apple-converted-space"> </span><br>
}<span class="Apple-converted-space"> </span><br>
set in_proc 0<span class="Apple-converted-space"> </span></span></span><br>
</p>
<font size="2"> }<br>
____________________<br>
rancid@machine:~/bin$ ./clogin_P330 -c "show l2-module-config"
X.X.X.X<br>
<br>
set port vlan-binding-mode 3/101 bind-to-all<br>
set port vlan-binding-mode 3/105 bind-to-all<br>
<br>
Error: TIMEOUT reached<br>
rancid@machine:~/bin$<br>
_______________________<br>
debug expect<br>
expect: does "\n" (spawn_id exp6) match regular expression
"[\n\r]"? (No Gate, RE only) gate=yes re=yes<br>
expect: set expect_out(0,string) "\n"<br>
expect: set expect_out(spawn_id) "exp6"<br>
expect: set expect_out(buffer) "\n"<br>
expect: continuing expect<br>
<br>
expect: does "" (spawn_id exp6) match regular expression "[\n\r]"?
(No Gate, RE only) gate=yes re=no<br>
"--type q to quit or space key to continue--"? no<br>
<br>
expect: timed out<br>
<br>
Error: TIMEOUT reached<br>
rancidd@machine: ~/binrancid@machine:~/bin$</font>
</body>
</html>