If I run the command cat file | grep pattern, I get many lines of output. How do you concatenate all lines into one line, effectively replacing each \"\\n
cat file | grep pattern
\"\\n
This is an example which produces output separate by commas. You can replace the comma by whatever separator you need.
cat < 1 > 2 > 3 > 4 > 5 > EOD
produces:
1,2,3,4,5