I'm having a while loop and need to append the outcome of the loop to the list(like in python) in bash script. How to do that. I created an array but there are no commas in it. It has only space but I want commas so that I can use them in the .env file
arr=()
while [ ]
do
........
........
........
val='some value'
arr+=$val
done
echo ${arr}
output:
('some value1' 'some value2' 'some value3')
Expected Outcome:
['some value1','some value2','some value3']