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 "
"
with "" "
(end with "
followed by space)?
cat file | grep pattern | xargs sed s/
/ /g
isn't working for me.