One-liner to convert two newlines to one?
- by Joseph Turian
I have a file where I want to convert "\n" to " " and "\n\n" to "\n".
For example:
I
had
a
toy
.
It
was
good
.
Becomes:
I had a toy .
It was good .
Does anyone have a Unix one-liner for this operation?