Remove unwanted newlines from output on Linux.
Improved copy.