Sed: Difference between revisions

Created page with "The '''s'''tream '''ed'''itor. Sometimes the '''s'''hitty '''ed'''itor. <tt>sed</tt> works on lines at a time (mostly). Note that GNU and POSIX <tt>sed</tt> differ in some sig..."
 
 
Line 5: Line 5:
==Recipes==
==Recipes==
===Join pairs of lines===
===Join pairs of lines===
<tt>sed 'N;s/\n/,/'</tt>
<tt>sed 'N;s/\n/ /'</tt> replaces every other newline with a space. Replace the space with whatever you want.