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
In bash echo without quotes remove carriage returns, tabs and multiple spaces
echo
echo $(cat file)