perl telnet-如何处理多页输出

perl telnet-如何处理多页输出,perl,telnet,multipage,Perl,Telnet,Multipage,我正在编写一个脚本,通过保存输出“show run”来保存交换机配置,因为在固件中,通过tftp工作存在问题。 “show run”的输出除以postsMore:,Quit:q,一行: 他的工作成果是: # sh run no spanning-tree interface port-channel 1 shutdown exit interface port-channel 2 shutdown exit interface port-channel 3 shutdown exit inter

我正在编写一个脚本,通过保存输出“show run”来保存交换机配置,因为在固件中,通过tftp工作存在问题。 “show run”的输出除以posts
More:,Quit:q,一行:

他的工作成果是:

# sh run
no spanning-tree
interface port-channel 1
shutdown
exit
interface port-channel 2
shutdown
exit
interface port-channel 3
shutdown
exit
interface port-channel 4
shutdown
exit
interface port-channel 5
shutdown
exit
interface port-channel 6
shutdown
exit
interface port-channel 7
shutdown
exit
More: <space>,  Quit: q, One line: <return>
#sh运行
无生成树
接口端口通道1
关闭
出口
接口端口通道2
关闭
出口
接口端口通道3
关闭
出口
接口端口通道4
关闭
出口
接口端口通道5
关闭
出口
接口端口通道6
关闭
出口
接口端口通道7
关闭
出口
更多:,退出:q,一行:

如何修复它?

您的交换机上是否有将页面长度设置为零(0)的选项?如果是这样,您必须在执行“sh run”命令之前添加该命令。

在alcatel 6224和相同的Dell powerconnect 3548上,它可以工作:

my @lines = $telnet->cmd("terminal datadump");
@lines = $telnet->cmd("show run");
# sh run
no spanning-tree
interface port-channel 1
shutdown
exit
interface port-channel 2
shutdown
exit
interface port-channel 3
shutdown
exit
interface port-channel 4
shutdown
exit
interface port-channel 5
shutdown
exit
interface port-channel 6
shutdown
exit
interface port-channel 7
shutdown
exit
More: <space>,  Quit: q, One line: <return>
my @lines = $telnet->cmd("terminal datadump");
@lines = $telnet->cmd("show run");