gpt4 book ai didi

bash - 以非交互方式安装 Miniconda2

转载 作者:行者123 更新时间:2023-12-02 00:44:04 24 4
gpt4 key购买 nike

是否可以按顺序向安装脚本发送多个响应?具体来说,如果安装脚本要您按 enter,然后按 Q,然后按 yes,就像这篇文章中那样:install miniconda .

我尝试将一些东西放在一起,但由于我对 bash 脚本非常不熟悉,我可能只是把它搞砸了或者采用了错误的方法。


编辑:

我尝试编写一个 expect 脚本,但它挂起,如下图所示。

#!/usr/bin/expect -f
spawn ~/Miniconda-latest-Linux-x86_64.sh
set timeout -1
expect "$ "
send "\r"
expect "Welcome "
send "Q"
expect "? "
send "yes"

expect script

最佳答案

这不需要任何人工干预

>curl "https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh" -o miniconda_installer.sh 
>bash miniconda_installer.sh -b -f -p $InstallDirectory

关于bash - 以非交互方式安装 Miniconda2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44982520/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com