进度条在以后开发,测试,运维中,可实现自动化检查项目的更新、运行等情况,大大加快工作效率。
1.代码实现1#!/bin/bash
2functionproc()
3{
4count=0
5bar=""
6lable=("|""/""-""\\")
7while[$count-le100]
8do
9letindex=count%4
10printf"[\033[1m\033[1;34m%-101s\033[0m][%d%%][%c]\r""$bar""$count""${lable[$index]}"
11bar=${bar}‘=‘
12((count++))
13sleep0.05
14done
15printf"\n"
16}
17proc
2.输出结果: