Shell script Small program in the preliminary-progress bar __ Applet

Source: Internet
Author: User

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 ...


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.