I tried to delete all the lines of a new line in a channel like this:
(echo foo; echo bar) | sed -e :a -e N -e '$!ba' -e 's/\n/ /g' | hexdump -C
What results compress debian into:
00000000 66 6f 6f 20 62 61 72 0a |foo bar.|
00000008
Do not delete the ending newline.
tr -d '\n'as in How to delete lines from a text file? works just fine, but not sed.
source
share