But, the program do not recognize the for instruction and generates only one output, corresponding to the first program. Neither the echo instructions.
What is the problem? I am working on MacOS X 10.6.8 and i tried execute on Terminal and X11, and isn´t chmod problem…
#The code for count perl execution time, for each archive in Prueba Folder.
#!/bin/bash
FILES= ~/Desktop/ncRNA/Prueba/*
for f in $FILES
do
START =$(date +%s)
echo "Processing $f file..."
perl $f
END =$(date +%s)
DIFF=$(( $END - $START ))
echo "It took $DIFF seconds"
date
echo "It was completed"
done
exit
The output:
¿Cual fue el tiempo de caida libre?
42
Si el tiempo de caida libre fue de : 42 segundos, entonces
La velocidad en caida libre fue de 412.02 m/s^2
The problem is that you have space character before and after the equal sign. Omit any spaces before and after the equal sign when you set a variable.
Also put double quotes around the variables which may contains spaces or reserved characters. –>
"$f"instead of$f