title: Convert text file into a comma delimited string
body: <p>I don't seem to locate an SO question that matches this exact problem.</p>
  
  <p>I have a text file that has one text token per line, without any commas, tabs, or quotes.  I want to create a comma delimited string based on the file content.</p>
  
  <p>Input:</p>
  
  <pre><code>one
  two
  three
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>one,two,three
  </code></pre>
  
  <p>I am using this command:</p>
  
  <pre><code>csv_string=$(tr '\n' ',' &lt; file | sed 's/,$//')
  </code></pre>
  
  <p>Is there a more efficient way to do this?</p>