In bash script, I want to iterate over a list of values that I want to pass as parameters to a script in python. It turns out that $d and $minFreq aren’t floats when passed to the python script. Why does this happen?
for d in {0.01, 0.05, 0.1}
do
for i in {1..3}
do
someString=`python scrpt1.py -f myfile --delta $d --counter $i| tail -1`
for minFreq in {0.01, 0.02}
do
for bValue in {10..12}
do
python testNEW.py $someString -d $bValue $minFreq
done
done
done
done
Either remove the spaces
or don’t use the {} expansion (it’s not necessary here):
The same applies to the
minFreqloop.As written,
the variable
dis assigned the literal string values{0.01,,0.05,, and0.1}.