Progress bar in the future development, testing, operation and maintenance, can be automated inspection project updates, operation and so on, greatly accelerate the efficiency of work.
1. Code implementation
1 #!/bin/bash 2 function proc () 3 { 4 count=0 5 bar= "" 6 lable= ("|" "/" "-" "\") 7 while [ $count -le 100 ] 8 do 9 let index=count%4 10 printf "[\033[1m\033[1;34m%-101s\033[0m] [%d%%] [%c]\r" "$bar" "$count" "${lable[$ Index]} " 11 bar=${bar} ' = ' 12 ((count++)) 13 sleep 0.05 14 done 15 printf "\ n "&Nbsp;16 } 17 proc
2. Output Result:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/82/DB/wKiom1dioIbQeeYpAAAN8_TSNQg227.png "title=" bar. PNG "alt=" Wkiom1dioibqeeypaaan8_tsnqg227.png "/>
This article is from the "sunshine225" blog, make sure to keep this source http://10707460.blog.51cto.com/10697460/1790053
Progress bar--shell Script implementation