My question would be what is the point of the 2 inner loops when you could have your single bash loop and a single awk doing all the work?
Something like:
Code:
for path in some-path/{0..29}/parameters
do
awk '{for(k=0;k<30;k++){count=0;for(l=1;l<31;l++)if(k*6 <= $3 && $3 < l*6)count++;print count / 10098 > gensub(/[^/]*$/,"","1",FILENAME)k"-awk-test"}}' "$path/angle-deviation.txt"
done
Now I haven't checked it exactly, but I am sure you get the drift