#!/usr/bin/expect
#set timeout 30
spawn ssh username@ipaddr
expect "Password:"
send "$password\r"
expect "Select group:"
send "/$172.0.0.1\r"
expect "Select account:"
send "4\r"
interact
#命令模式根据实际修改。