The basis of a simple progress bar
1. Arrays
Bash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. Similar to the C language, the subscript of an array element is numbered starting with 0. Gets the elements in the array to take advantage of subscript, the subscript can be an integer or an arithmetic expression whose value should be greater than or equal to 0.
Define an array: In the shell, the array is represented by parentheses, and the elements of the array are separated by a "space" symbol.
The general format for reading array element values is: ${array_name[index]}.
The general format for reading all the values of an array element is: ${array_name[*]} or ${array_name[@]}.
Find the length of the array:${#array_name [*]} or ${#array_name [@]}.
2.while Cycle
Format: while [condition]
Do
.
.
.
Done
The while loop starts with do and ends with done.
Second, the code implementation and results
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/85/A4/wKiom1eqz3rz6__hAABR-IY-f48019.jpg-wh_500x0-wm_3 -wmp_4-s_631630572.jpg "title=" 36020160810145313816.jpg "alt=" Wkiom1eqz3rz6__haabr-iy-f48019.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/85/A3/wKioL1eq0O-zSxECAAAUt41utHI650.jpg-wh_500x0-wm_3 -wmp_4-s_1565269052.jpg "title=" 36020160810145927968.jpg "alt=" Wkiol1eq0o-zsxecaaaut41uthi650.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/85/A4/wKiom1eq0NKzBy6aAAA1OCpyJsk865.jpg-wh_500x0-wm_3 -wmp_4-s_156628750.jpg "title=" 36020160810145907024.jpg "alt=" Wkiom1eq0nkzby6aaaa1ocpyjsk865.jpg-wh_50 "/>
This article is from the "11441519" blog, please be sure to keep this source http://11451519.blog.51cto.com/11441519/1836555
Simple progress bar for shell scripts