expect

expect: command not found

执行:

yum -y install expect

从最简单的层次来说,Expect用来实现计算机之间需要建立连接时进行特定的登录会话、


function login(){
echo "in"
expect_sh=$(expect -c "
spawn kinit ${LOGIN_USER_NAME}
expect \"*assword*BAIDU.COM:\"
send \"${LOGIN_USER_PASSWORD}\r\"
expect \"#\"
")

echo "$expect_sh"
}
#expect -c '
#spawn kinit hdfs
#expect "*assword*BAIDU.COM:"
#send "password123\r"
#expect "#"
#'



 

posted @ 2018-10-31 16:06  zsls-lang  阅读(326)  评论(0编辑  收藏  举报