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