expect

Posted searchor

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了expect相关的知识,希望对你有一定的参考价值。

#!/usr/bin/expect
spawn ssh remotehost
expect "*some key word*"
send "kinit -f
"
expect "*assword*"
send "password
"
send "cmd1
"
send "cmd2
"
send "df -h
"
send "hostname
"
send "date
"
interact

 

以上是关于expect的主要内容,如果未能解决你的问题,请参考以下文章