using tr to put multiple lines of output into one line

Hi all,

For a intro UNIX course I'm taking, I need to use the command "tr" to display a file on standard output without any newlines (all on one line).

I assume I would start with "cat filename | tr" but don't know what to put after tr.

Any ideas would be lovely!
Thanks.

tr "\n" " " < filename

i.e. change newlines (\n) to spaces

HTH

tr -d '\n' < file

You need to read your text on tr. Plus, we do not want homework on the forums.

thanks!

no more homework, my bad.