Description
Here we define 'block' as a set of consecutive lines which contain some string, for example '<OPTION>'.
Now we want to add a line '---End of options---' to the end of every block.
Raw Input
The main Linux distributions are:
 <OPTION> Red Hat
 <OPTION> Mandrake
  <OPTION> SuSE
   <OPTION> Slackware
Main window manager used in Linux are:
   <OPTION> Sawfish
  <OPTION> enlightenment
   <OPTION> fvwm
Desired Output
The main Linux distributions are:
 <OPTION> Red Hat
 <OPTION> Mandrake
  <OPTION> SuSE
   <OPTION> Slackware
---End of options---
Main window manager used in Linux are:
   <OPTION> Sawfish
  <OPTION> enlightenment
   <OPTION> fvwm
---End of options---
Script and Comments
Script1
[ 1] /<OPTION>/{
[ 2] $!N
[ 3] P
[ 4] /\n.*<OPTION>/!i\
[ 5] ---End of options---
[ 6] D
[ 7] }
Comments
  1. If a line does not contain \ at all, just print it out and start next cycle.
  2. If a line contains \, Step [2] will join next line if exists.
  3. After Step [2], Pattern Space may contains
    Pattern Space
    (... stands for any text)
    description actions to take
    ...\... only one line i
    ...\...\n ..... the joined line does not contain \ P,i,D
    ...\....\n...\... the joined line contains \ P,D