in reply to Re^3: How to pass --MORE--
in thread How to pass --MORE--

hi salva thanks for your advices. here is the outputs of help command on CLI
Mediant 800> help Use '?' in order to show available commands. 'TAB' can completion Use 'list' to see all available commands Mediant 800> enable Turn on privileged commands exit Exit from current mode help Show available commands history Show a list of previously run co list Available command list nslookup resolve host name ping Ping packets pwd Display current configuration mo quit Disconnect show Show running system information
Could you please give some examples about the usage of Expect and Net:Telnet to ignore --more--? I've made some tests like below but it does not make sense could you please check?
$telnet->print('show running-config'); while( my $line = $telnet->getline() ) { push @lines, $line; $match = $telnet->waitfor(Match => '/\-\-More\-\-$/i'); if ($match =~ /\-\-More\-\-/){ $telnet->print(" "); } }

Replies are listed 'Best First'.
Re^5: How to pass --MORE--
by salva (Canon) on Feb 15, 2015 at 20:59 UTC
    It seems list would give you the full list of commands.

    The problem with your code may be the device not sending a CRLF after the --MORE-- prompt, so getline just stalls waiting for one.

    Try using the following code instead:

    while(1) { my $match = $telnet->waitfor(Match => '/^--More--$/i', Match => '/^Mediant 800 >/i', Mathc => '/.*$/'); last unless defined $match; if ($match =~ /^--More--/i) { $telnet->print(' '); # ignore line } elsif ($match =~ /^Mediant 800 >/i) { # back at command prompt; last; } else { push @lines, $match; } }