expect保存交换机show信息

#!/bin/bash
/usr/bin/expect <<-EOF
log_file test1-11
#spawn ssh

spawn ssh net@10。1.1.1
expect "password:"
send "123456\r"
expect "#"
send "show interface Ethernet1/11 |grep CRC\r"


#send "ls\r"
#expect eof
#send "df\r"
expect eof
exit
EOF

posted @ 2018-02-24 13:55  *奥特*  阅读(181)  评论(0编辑  收藏  举报