我已经登录了CUCM,然后我们正在尝试执行一个正确的命令,但通过预期值我们无法执行第二个命令。 第一我们正在做这样的: -期望编程:如何期待一个特定的字符串
send -i $install_id "utils ctl set-cluster mixed-mode\r\n"
puts "we are hitting yes &&&&&&&&&&"
expect {
-i $install_id -re ".*" {
send -i $install_id "y\r"
puts "$$$$$$$$$$$$$$$ we are inside...."
}
}
puts "we are done %%%%%%%%%%"
return 1
这里第一个命令send -i $install_id "utils ctl set-cluster mixed-mode\r\n"
是越来越成功地执行,但它不是指望循环中去。
第一个命令的输出是一样的东西: -
admin:utils ctl set-cluster mixed-mode
This operation will set the cluster to Mixed mode. Do you want to continue? (y/n):
在此之后,光标会在下一行,其中我不得不放弃y和输入,输出语句内的期望也没有得到印
您可以尝试在详细模式下执行这些命令。在第一次发送之前添加'exp_internal 1'。 –
我没有得到...因为我是新来的这些编程...你究竟想要添加什么 – user3388407
你正在运行一个除了脚本或只有期望界面的命令吗? –