How to proceed with the word “MORE” to get to the end of the command

谁都会走 提交于 2020-08-26 10:34:05

问题


enter image description here

On a real device when I want to access "show gpon onu state" it takes a few presses of the space bar to get to the end of the line. for paramiko how to eliminate the word "more" so that you get to the end of the line?


回答1:


There are several solution type for this case:

  1. Each brand has a screen-length command for this issue. You can enter this command first.

    • Cisco: terminal length 0
    • Huawei : screen-length 0 temporary
    • Nokia/Alcatel : environment no more
    cmd.send("terminal length 0" + '\r')
    time.sleep(1)
    
  2. You can send the space or enter command after your actual command. Space command gives you several lines, enter command gives you one line more.

    cmd.send("display interface description" + '\r')
    time.sleep(1)
    cmd.send(" " + '\r')
    time.sleep(1)
    cmd.send(100 * '\r')
    time.sleep(1)
    


来源:https://stackoverflow.com/questions/60704144/how-to-proceed-with-the-word-more-to-get-to-the-end-of-the-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!