分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
v-lhb-prx01:/root/sbin# sh ./expect.sh spawn ssh root@192.168.32.16The authenticity of host '192.168.32.16 (192.168.32.16)' can't be established.RSA key fingerprint is da:3a:61:09:e4:f6:46:d7:01:08:1a:6c:b9:41:e8:4c.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.32.16' (RSA) to the list of known hosts.root@192.168.32.16's password: Last login: Wed May 27 09:37:32 2015 from 192.168.33.107v-dev-redis02:/root# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/vg00-lv_root 7.7G 5.6G 1.8G 77% /tmpfs 499M 0 499M 0% /dev/shm/dev/sda1 194M 29M 155M 16% /bootv-dev-redis02:/root# exitlogoutConnection to 192.168.32.16 closed.-----------------------------------------------------------------------------------expect { "(yes/no)?" { send "yes\n" expect "password:" send "$passwd\n" } "password:" { send "$passwd\n" } }# 下面测试是否登录到 expect "#" send "df -h\n"send "exit\r"expect eof