1 2 3 4 5 6 |
declare -i SW=0 SX=0 SY=0 SZ=0 while IFS='' read LINE; do SW+=${LINE:0:5} ; SX+=${LINE:5:5} SY+=${LINE:10:5} ; SZ+=${LINE:15:5} done < sample.txt printf " %4d %4d %4d %4d\n" $S{W,X,Y,Z} |
1 2 3 4 5 6 |
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 1 1 1 1 |
1 |
1 6 11 16 |
Recent Comments