Return to Snippet

Revision: 45925
at May 11, 2011 05:16 by bubnoff


Initial Code
sed '$!N;s/\n/ /'

Initial URL


Initial Description
Merge line below to current line. 

"This one-liner joins two consecutive lines with the "N" command. They get joined with a "\n" character between them. The substitute command replaces this newline with a space, thus joining every pair of lines with a whitespace."

From catonmat here:

http://www.catonmat.net/blog/sed-one-liners-explained-part-one/

Initial Title
Merge lines with SED.

Initial Tags


Initial Language
Bash