read i < ../i
read n < ../n
read redirection < ../redirection

liste=`ls`
while test "${#liste}" -ge "3" ; # true iff liste is not empty (liste="xaa ...")
do
j=`echo $liste | cut -d ' ' -f 1 ` # j = first data file given by liste

if
test $redirection -eq 1
then
cat ../datas ../../groups/group.$n.$i $j > ./.input_file_B # input_file_B is hidden so as to be not listed by 'ls'
../../bin/calculate_B < ./.input_file_B >> ../output.$n.$i
else
cat ../datas ../../groups/group.$n.$i $j > ./.input_file_B
../../bin/calculate_B < ./.input_file_B 
fi
rm -f ./.input_file_B
rm -f ./$j
liste=`ls`
done

echo "processing of one input file over"