I wanna loop through the array and print out each element in a bash script:
array=(10, 0.2, 0.03,)
for ele in ${array[@]}
do
echo "$ele blah"
done
However, it spits out:
10, blah
blah
0.2, blah
blah
0.03 blah
Even if I added
IFS=","
The result is :
10 blah
blah
0.2 blah
blah
0.03 blah
How can I get:
10 blah
0.2 blah
0.03 blah
After this, I would like to align each line like:
10.00 blah
0.200 blah
0.030 blah
Updated:
With the 1st and 2nd column separated by 6 spaces
Is there any easy way to do this? Thanks.