# !/usr/bin/expect -f
ambari-server sync-ldap --all
# wait until the prompt shows "enter username". Change this to adapt to your application.
expect "enter username"
send "your_username\r"
# wait until the prompt shows "password: ". Change this to adapt to your application.
expect "password: "
send "yourPAssWoRD\r"
interact
2条答案
按热度按时间nfg76nw01#
尝试使用下面的脚本
h6my8fg22#
查看expect。
一个简单的例子是使用下面的脚本。
免责声明:我从未使用过
ambari-server
之前的命令。