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 "#"
#'
本文来自博客园,作者:zsls-lang,转载请注明原文链接:https://www.cnblogs.com/zsls-lang/p/9883797.html
行也思卿,坐也思卿
日高三竿我犹眠,不管人间万里愁