use*_*460 3 bash whiptail progress-information
我知道我可以使用以下方法更改whiptail --gauge 的进度:
{
for ((i = 0 ; i <= 100 ; i+=20)); do
sleep 1
echo $i
done
} | whiptail --gauge "Please wait while installing" 6 60 0
Run Code Online (Sandbox Code Playgroud)
但我想知道是否可以编辑/修改鞭尾框的Please wait while installing文本(因此将文本更改为其他内容。
我目前的解决方案是调出一个新的鞭尾盒,但在旧的关闭和新的打开之间有明显的闪烁。如果您无法更新鞭尾框的文本,是否可以减少/消除此闪烁?
尝试这个:
#!/bin/bash
msgs=( "Downloading" "Verifying" "Unpacking" "Almost Done" "Done" )
for i in {1..5}; do
sleep 1
echo XXX
echo $(( i * 20 ))
echo ${msgs[i-1]}
echo XXX
done |whiptail --gauge "Please wait while installing" 6 60 0
Run Code Online (Sandbox Code Playgroud)