expect wait --More-- string and exit

Hi

I am programing a expect script on debian, I connected to a firewall to get configuration copy via telnet or ssh but Because of firewall show configuration console wait and print --More-- need press space key at least 100.Help me please.

firewall output like this :frowning:

This output isn't firewall full config and expect script wait and exit.Thus my expect script not run that I want.

my expect script is like this

***************expect.sh**********
#!/bin/expect
spawn telnet 10.1.1.1

expect -re "Login" {
                send "admin";
                }  

expect -re "Password" {
                send "123";
                }

expect -re "firewall#" {
                send "show config";
                }
exit
***********bash command***********
Debian#./expect.sh > backupfirewall.cfg
**********************************

My first thought is that you need to introduce a while statement in your expect script to read the troublesome -----More-- text and send a carriage return when it happens.

Hi
Please show me on my script correct form.

You should do your work and post your attempt to write a script and not simply ask people to do your work for you. I have given you the basic idea, so I suggest you do some of your own work first and attempt to solve your problem yourself and post back your work.