title: Store array output to comma separated list in bash scripting
body: <p>I have taken input from user into array. But I need to use them as comma separated list. How can I do that? Input in my case is path like (/usr/tmp/). I appreciate your help and time. Thank you !</p>
  
  <p>Example:</p>
  
  <pre><code>read "Number of subdirectories : " count
  for i in $(seq 1 $count)
  do
      read -e -p " Subdir : $i: " arr[$i]
  done
  </code></pre>
  
  <p>Expected Result:</p>
  
  <pre><code>$var = {arr[1],arr[2],arr[3],......}
  </code></pre>