Note: If you are the factory of children's shoes, write homework to find this article, I hope you do not copy ^_^, in fact, try to knock on your own will help you a lot.
The title requirement is to student.txt the results of each stage of the statistics, the text format is "study number: Results".
Here is my approach:
#! bin/bashs=$ (Cat Score.txt | cut-d:-F 2 | tr "", "); arr= ($s); num= (0,0,0,0,0); grade= (0,0,0,0,0); for x in ${arr[@]};d OIF [$ ((x))-lt 100-a $ ((x))-gt];thennum[0]=$ (($ (((num[0)) + 1)); grade[0]=$ ((Grade[0] + $ ((x)))); Elif [$ ((x))-GT 80 ];thennum[1]=$ (($ ((num[1)) + 1)); grade[1]=$ ((Grade[1] + $ ((x))); Elif [$ ((x))-gt (($ ((];thennum[2]=$]) + 1)); grade[2]=$ ((Grade[2] + $ ((x))); Elif [$ ((x))-gt];thennum[3]=$ (($ (((num[3)) + 1)); grade[3]=$ ((Grade[3] + $ ((x))); El Senum[4]=$ (($ ((num[4)) + 1)); grade[4]=$ ((Grade[4] + $ ((x))); Fidoneecho the AVG score of 90~100 is $ ((${grade[0]}/${num [0]}), and the number of student is ${num[0]};echo the Avg. score of 80~89 is $ ((${grade[1]}/${num[1]}), and the number O F student is ${num[1]};echo the AVG score of 70~79 are $ ((${grade[2]}/${num[2]}), and the number of student is ${num[2]}; echo the AVG score of 60~69 is $ ((${grade[3]}/${num[3]}), and the number of student is ${num[3]};echo the AVG score of ~ is $ ((${grade[4)}/${NUM[4])), and the number of student is ${num[4]};
Getting started with Shell programming score statistics