【发布时间】:2018-12-19 14:41:09
【问题描述】:
我正在编写一个安装脚本,并希望在脚本运行过程中显示脚本的状态。
示例:
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之类的内容。 -
你能澄清一下你所说的“刷新”是什么意思吗?你的意思是你想要一些“表单”或“屏幕”的输出,只有某些字段更新?并且在给定时间可能有多个这样的字段?还是仅在 item1 完成后才开始 item2 的状态(同样在 item2 之后的 item3)?
标签: bash