I have this code inside a file called test.sh When I try to run
nohup ./teste.sh &
he gives this error. Can anyone explain me?
./ teste.sh: 9: ./teste.sh: Syntax error: Bad for loop variable
CODE
cuda="cuda.out";
cpu="cpu.out";
cudaTxt="cuda.out.txt";
cpuTxt="cpu.out.txt";
trash="/dev/null";
rm -f $cudaTxt;
rm -f $cpuTxt;
for ((i=10001;i<=1000001;i+=10000));
do
echo "Cuda, $i iteração";
head -n$i formulas.txt > formulas_pre-processadas_CUSTOMIZADA.txt;
echo -en "$i\t" >> $cudaTxt;
./$cuda | cut -c19- >> $cudaTxt;
done;
for ((i=10001;i<=1000001;i+=10000));
do
echo "CPU, $i iteração";
head -n$i formulas.txt > formulas_pre-processadas_CUSTOMIZADA.txt;
echo -en "$i\t" >> $cpuTxt;
./$cpu | cut -c19- >> $cpuTxt;
done;
echo "Acabou";