我正在编写一个脚本来自动安装ambari服务器。 我在tcl脚本上创建了自动化ambari-server设置。我的问题是在一个地方下载并安装jdk,并且该步骤需要一点时间,同时另一个预期的其他发送会在屏幕上弹出,并将所有安装完成。TCL中两个期望之间的延迟
我的脚本:
#!/usr/bin/expect
spawn sudo ambari-server setup
expect "OK to continue"
send "y\r"
expect "Customize user account for ambari-server daemon"
send "y\r"
expect "Enter user account for ambari-server daemon (root):"
send "root\r"
expect "Enter choice (1):"
send "1\r"
expect "Do you accept the Oracle Binary Code License Agreement"
send "y\r"
expect"Enter advanced database configuration"
send "y\r"
expect "Enter choice (1):"
send "3\r"
expect "Hostname (localhost):"
send "localhost\r"
expect "Port (3306):"
send "3306\r"
expect "Database name (ambari):"
send "ambari\r"
expect "Username (ambari):"
send "ambari\r"
expect "Enter Database Password (bigdata):"
send "password\r"
expect "Proceed with configuring remote database connection properties"
send "y\r"
接受甲骨文二进制代码许可协议后,下载并安装JDK并在这期间它开始服用发送下节选的。
有人可以建议我如何停止除前一个仍在运行的执行。 我曾尝试使用后,睡觉尝试的东西,但它没有奏效。 谢谢
为什么会有人downvote呢?为什么这不是一个足够好的问题?我确实分享了我的代码,我写了我所尝试的。如果你在付出这么多努力的时候善意地留下了为什么你这么做的理由。 –
我发现一个临时修复通过把设置超时足够长的时间来安装jdk。如果仍然有人可以提出更好的解决方案,那将非常棒。 –
可以在下载和安装jdk进行和结束时显示安装sctipt的输出吗? – komar