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 "
expect "#"
send "show interface Ethernet1/11 |grep CRC "


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

原文地址:https://www.cnblogs.com/han1094/p/8465480.html