private[1]

#!/bin/bash myfun() { echo -e "read/n" i=1 minus=0 max=-32768 min=32767 avr=0 totel=0 num=`cat "$1"|wc -l` echo -e "num is $num/n" cat "$1" | while read line do var1=`cat "$1"|head -n $i|tail -n 1` #数字键盘的左边 var2=`cat "$2"|head -n $i|tail -n 1` let result=var1-var2 let totel=result+totel ##echo -e "$var1-$var2=$result/n" #let i=i+1 #i++ #echo $line if [ "$result"=="-*" ] #(("$result"<0))#[ "$result"-lt"$zero" ]; then let minus=minus+1 ##echo -e "minus is $minus/n" fi if (("$var1" >= "$var2")) then if (("$var1">"$max")) then let max=var1 fi if (("$var2"<"$min")) then let min=var2 fi else if (("$var2" > "$max")) then let max=var2 fi if (("$var1"<"$min")) then let min=var1 fi fi ##echo -e "i=$i/n" #let totel=result+tolel #done #let i=i-1 let avr=totel/i let i=i+1 if [ "$i" -eq "$num" ] then echo -e "minus=$minus/n" echo -e "min=$min/n" echo -e "max=$max/n" echo -e "avr=$avr/n" fi done } echo -e "$1|$2/n" myfun $1 $2

 

 

你可能感兴趣的:(private[1])