You're viewing a comment by Anirudh and its responses.

Anirudh Permalink
February 01, 2016, 16:01
sed -e '
# initialize paragraph counter to 1
1{x;s/.*/./;x}

# each paragraph handled here
/./,/^$/{
   /./{H;d;}
# stash the present line ofthe current para to hold space

   # interrogate the paragraph counter
   # a) if success, then print para and quit promptly
   # b) if no, then increment counter and clear hold space

   x
      /^[.]\{3\}\n/{
         # SUCCESS
         s///; q
      }
      # NOT THERE YET...
      s/\n.*//
      s/^/./
   x
}

# non-interesting lines
d
'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "browser_95": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.