Issue
I 'm using linux shell.
I want to join the ls .
result into a string.
for example:
a=`ls .`
echo $a
then the $a will be "file1 file2 file3"
but I want it to be "file1,file2,file3"
hot to realize this?
Solution
$ ls -xm
$ # or
$ echo `ls .`|sed 's/ /,/g'
Answered By - micfan