I am trying to read a text file which contains the following sample values:
Apple
Banana
Carrot
...I will then need write them to a variable as a single line delimited by comma.
var1=Apple,Banana,Carrot
How does one do it using bash script? Thank you in advance.