I have a string variable in bash
$ t_partitions='p0,p1,p2'
I need to convert this string variable into
$ t_partitions=''p0','p1','p2''
Can someone help
Here is my attempted solution
t_partitions="p0,p1,p2"
new="'"
for (( i=0; i<${#t_partitions}; i++ )); do
if[${t_partitions:$i:1}==",”];
then
$new+="'"
$new+="${t_partitions:$i:1}”
$new+="'"
else
$new+="${t_partitions:$i:1}”
fi
done
$t_partitions=$new