gpt4 book ai didi

linux - Bash Roundcube 脚本无声

转载 作者:太空宇宙 更新时间:2023-11-04 10:32:33 25 4
gpt4 key购买 nike

<分区>

我正在尝试将以下行添加到 bash 脚本中:

bin/installto.sh /var/www/mail/rc >/dev/null 2>&1

应该没有输出,但升级安装程序需要确认是:

~/roundcubemail-1.2.1# bin/installto.sh /var/www/mail/rc
Upgrading from 1.1.3. Do you want to continue? (y/N)

有没有什么方法可以像 apt-get upgrade -y 一样通过自动确认进行静默升级

最好的问候,爱丽丝

编辑:

直到现在我才知道expect命令
我的脚本:

cd roundcubemail-1.2.1 >/dev/null 2>&1
expect -c 'bin/installto.sh /var/www/mail/rc >/dev/null 2>&1'
expect "Do you want to continue? (y/N)"
send "y"
interact
rm -r /root/roundcubemail-1.2.1/ >/dev/null 2>&1
[...]

--->结果

"bin/installto.sh /var/www/mail/rc"
couldn't read file "Do you want to continue? (y/N)": no such file or directory
/root/update.sh: Zeile 104: send: command not found.
/root/update.sh: Zeile 105: interact: command not found.

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