title: Bash to join a list
body: <p>How to join a list with proper delimiter using shell script &amp; tools?</p>
  <p>E.g., given,</p>
  <pre class="lang-bash prettyprint-override"><code>$ seq 3 
  1
  2
  3
  </code></pre>
  <p>The <code>seq 3 | list_join</code> will produce <code>1,2,3</code>, without the trailing <code>,</code>.</p>
  <p>The <code>seq</code> is just a <em>sample</em> input, the <em>actual</em> input can come from <em>anywhere</em> and there should be no assumption on the input content/format except each ends with a new line.</p>
  <p><strong>UPDATE:</strong></p>
  <p>I asked for <em>&quot;shell script &amp; tools&quot;</em> so I'm accepting the current <em>shell script</em> solution, although I personally would use Fravadona's solution:</p>
  <pre class="lang-bash prettyprint-override"><code>$ jot -w 'Entry %c' 5 'A' | tee /dev/tty | paste -s -d ','
  Entry A
  Entry B
  Entry C
  Entry D
  Entry E
  Entry A,Entry B,Entry C,Entry D,Entry E
  </code></pre>