Discussion:
[rancid] avaya P330 - don't match eof
LMR_J-P
2011-04-04 17:45:56 UTC
Permalink
hi

I have to retrieve a configuration AVAYA P330
I'm stuck at the end of my script.
manually, I have to press enter to retrieve the prompt and I can not
find the piece of code that I miss.
can someone help me, thank you very much

CLOGIN SCRIPT
# Run commands given on the command line.
proc run_commands { prompt command } {
global in_proc
set in_proc 1
log_user 1
send "\r"
expect -re $prompt {}

set commands [split $command \;]
set num_commands [llength $commands]
for {set i 0} {$i < $num_commands} { incr i} {
send -- "[subst [lindex $commands $i]]\r"

expect {
-re "\[\n\r\]" {exp_continue }
-gl "--type q to quit or space key to
continue--" { send "\r\n" ; exp_continue }
}
}
send "quit\r"
expect {
"\n" { exp_continue }
timeout { catch {close}; catch
{wait};
return 0
}
eof { return 0 }
}
set in_proc 0

}
____________________
***@machine:~/bin$ ./clogin_P330 -c "show l2-module-config" X.X.X.X

set port vlan-binding-mode 3/101 bind-to-all
set port vlan-binding-mode 3/105 bind-to-all

Error: TIMEOUT reached
***@machine:~/bin$
_______________________
debug expect
expect: does "\n" (spawn_id exp6) match regular expression "[\n\r]"? (No
Gate, RE only) gate=yes re=yes
expect: set expect_out(0,string) "\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\n"
expect: continuing expect

expect: does "" (spawn_id exp6) match regular expression "[\n\r]"? (No
Gate, RE only) gate=yes re=no
"--type q to quit or space key to continue--"? no

expect: timed out

Error: TIMEOUT reached
***@machine: ~/bin***@machine:~/bin$
john heasley
2011-04-04 19:31:30 UTC
Permalink
Mon, Apr 04, 2011 at 07:45:56PM +0200, LMR_J-P:
> expect: does "\n" (spawn_id exp6) match regular expression "[\n\r]"? (No
> Gate, RE only) gate=yes re=yes
> expect: set expect_out(0,string) "\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\n"
> expect: continuing expect
>
> expect: does "" (spawn_id exp6) match regular expression "[\n\r]"? (No
> Gate, RE only) gate=yes re=no
> "--type q to quit or space key to continue--"? no

you need to match & respond to the pager
Loading...