The progress bar and maximum minimum average under the shell

Source: Internet
Author: User

Progress bar

C Language progress bar reference my original article blog-> progress bar

Function proc () {     i=0      str= '       arr= (' | ')   '/'   '-'   ' \ \ ')      index=0     while [   $i  -le 100 ]     do          printf  "[%-101s][%d%%][%c]\r"   "$str"   "$i"   "${arr[$index]}"                                                                                                   & nbSP;  STR=${STR} ' # '          sleep 0.1          let i++          let index++         let index%=4      done     printf  "\ n"}  function main () {     proc}main

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/24/wKioL1e1vvWBsDsKAAApEbb8WqM117.png "title=" Proc. PNG "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:1000PX;HEIGHT:69PX; "alt=" Wkiol1e1vvwbsdskaaapebb8wqm117.png "/>

Maximum, minimum, average value

#!/bin/bash                                                                                                                                                       max=0min=0count=0sum=0while read linedo    if [  $count  -eq  0 ];then    max= $line     min= $line     let count++     let sum+= $line     continue    fi     [  "$max"  -lt  "$line"  ] && max= $line     [  "$min"  -gt  "$line"  ] && min= $line     let sum+= $line     let count++done<fileecho  $maxecho   $minecho   "ibase=10;  scale=2;  $sum/$count "&NBSP;|&NBSP;BC

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/24/wKiom1e1vxHQCzHtAAAylqi7jC0844.png "title=" Max_ Min_aver. PNG "width=" "height=" 212 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:212px; "alt=" Wkiom1e1vxhqczhtaaaylqi7jc0844.png "/>


This article from the "777 Fast" blog, declined reprint!

The progress bar and maximum minimum average under the shell

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.