believe that the progress bar everyone is not unfamiliar, every time you download something or software will be prompted by the current download task to achieve how much, of course, can have different languages to achieve, today I use a shell script to achieve progress bar
The first thing you need to know is that the progress bar is divided into progress, display percentages, and a dynamic progress demo (rotation bar)
The general progress bar is 100 units, so you can use the loop to achieve
As for dynamic rotation, you can use an array to implement
Realize:
Analysis:
1 lable array is the dynamic rotation of the part, (that is, this is not to implement the dynamic diagram, or you can feel)
2 Bar is the 1~100 progress bar to cover the running part
3)%i Reality is the percentage of progress
Implementation results:
There is no dynamic effect, otherwise there will be better results, although this is relatively simple, but for beginners to practice practicing ...