#!/usr/bin/expect set timeout 10 spawn ssh pcs@11.17.1.2 expect "*Password*" send "密码\r" expect ">" send "ls;cd back/rate/;run.sh\r" expect eof
看看rsh -l 用户名 11.17.1.2 /pcs/back/rate>run.sh要先配置hosts等信任关系。