Possible Duplicate:
How can I do command line integer & float calculations, in bash, or any language available?
I would like to simply re-assign a variable (to be specific, increment it by 0.050) in a bash script. In the following script that I wrote, i is an (integer) index, and mytime is a decimal/double/float number. "ps" (picosecond) is the unit of time that I am using in my calculations.
#!/bin/bash
mytime = 0.000
for i in {1..3}
do
echo "$i: $mytime ps"
mytime = mytime + 0.050
done
But, when I run this script using bash test.sh, I get these error messages:
test.sh: line 2: mytime: command not found
1: ps
test.sh: line 6: mytime: command not found
2: ps
test.sh: line 6: mytime: command not found
3: ps
test.sh: line 6: mytime: command not found
Why does it seem to be interpreting mytime as a command or a function, instead of as a variable? Can you please help me to correct this?