title: Combining Grep and Paste command in bash
body: <p>very sorry to ask a stupid question but I'm getting crazy with this thing. </p>
  
  <p>So, I'm in bash and I have some files: </p>
  
  <pre><code>ls
  a.bed
  b.bed
  c.bed
  </code></pre>
  
  <p>all I want to do is create a variable that have all the 3 of them separated with a comma, this is the output I search for: </p>
  
  <pre><code>a.bed, b.bed, c.bed
  </code></pre>
  
  <p>What I'm using for now (but have spaces instead of commas is):</p>
  
  <pre><code>beds=$(ls|grep .bed)
  </code></pre>
  
  <p>which have</p>
  
  <pre><code>a.bed b.bed c.bed
  </code></pre>
  
  <p>Thank you so much</p>