How to replace newlines with commas using `tr`?
<p>I saw this: <a href="https://stackoverflow.com/questions/1251999/how-can-i-replace-a-newline-n-using-sed">How can I replace a newline (\n) using sed?</a>, and figured I would try to use <code>tr</code> to replace newlines with <code>',</code>.  </p>

<p>The file looks like this:</p>

<pre><code>something
newline
newline again
</code></pre>

<p>and I want it to look like this:</p>

<pre><code>something',
newline',
newline again',
</code></pre>

<p>So, I tried these:  </p>

<p><code>tr "\n" "'," &lt; myfileabove</code>
<code>tr "\n" "\'," &lt; myfileabove</code></p>

<p>Neither of them does what I'd like....am I doing something wrong?</p>