I'm using a bash script to run a program with several variables using a series of nested for loops, one of which needs to include decimals. As part of the process of switching between various sub-directories, I also need to be able to multiply that value by a constant, and that's the part that's giving me trouble. So for example:
#!/bin/bash
for a in 600 700 800
do
for c in 0 0.1 0.15
do
d=echo "$((100 * $c))" | bc -l
cd "$a"X/Y"$d"Z
pwd
cd ../../
done
done
Where X, Y, and Z are just text designators in the subdirectories. The issue I'm having is with getting an actual value for $d. I've tried all the solutions from this question: Multiplication on command line terminal and haven't gotten any of them to work. Is there another way to do this?