我正在编写一个安装脚本,并希望在脚本执行过程中显示脚本的状态。
例如:
var1="pending"
var2="pending"
var3="pending"
print_status () {
echo "Status of Item 1 is: "$var1""
echo "Status of Item 2 is: "$var2""
echo "Status of Item 3 is: "$var3""
}
code that does something and then refreshes the
output above as the status of each variable changes.
clear
命令,它可以清除屏幕。如果需要更高级的操作,请使用类似dialog
的工具。 - choroba