urgent-extracting block data from flat file using shell script

Hi,

I want to extract block of data from flat file.
the data will be like this

start of log
One
two
three
end of log

i want all data between start of log to end of log i.e One
two
three to be copied to another file.
This particular block may appear multiple times in same file. I want all the blocks to be directed to new file.

shirish

to clarify more
below will be content of file

start of log
One
two
three
end of log. i dont want start of log and end of log rows to be redirected to new file

Is this a homework question?

Regards

x=`grep -n "start of log" text | cut -d ":" -f1`
y=`grep -n "end of log" text | cut -d ":" -f1`
a=`echo ${x} + 1 | bc`
b=`echo ${y} -1 | bc`
echo $x $y $a $b
sed -ne "${a},${b}p" text

thanks. that worked