Q:

Bash + remove spaces from line

I wrote the following bash code in order to create CSV path with disks partitions , so each partition will get new increment dev disk 
number_of_disks=5
mount_p=({a..z})
path=` for i in \`seq 1 $number_of_disks \`; do mount_p="$(echo $mount_p| tr '[a-z]' '[b-z]a')"; echo /home/sd$mount_p/oop/app/data","; done `

but when I print the $path we get space between each partion 
echo $path
/home/sdb/oop/app/data, /home/sdc/oop/app/data, 
/home/sdd/oop/app/data, /home/sde/oop/app/data, 
/home/sdf/oop/app/data,

Second problem is the unnecessary "," at the end of the line
Based on my code how to create the path variable without space and without "," at the end of the CSV line

A:

You are using a very complex way (hacky as hell) to achieve something rather simple:
path=$(echo /home/sd{a..e}/oop/app/data | tr ' ' ,)

