Script to replace a string with pattern read from a file

I have two files blocks.txt and rules.txt. In blocks.txt i have the following entries

Linux1
Linux2
Linux3
.....
Linux10

In rules.txt i have the lines where a filename pattern starts like

'blk-name.*'

I want to replace 'blk-name' with the names read from blocks.txt file
I tried with following code.But it replaces with "$blocks".Could anyone pl. help me correct this

#!/usr/bin/ksh

for blocks in $(cat blocks.txt)
do
BlktoAdd=$blocks
cat rules.txt|while read line
do
sed -i 's/blk_name/$blocks/'
done
done

Try double quotes in lieu of single quotes to enable shell's "variable expansion".

EDIT: But, there's more to comment on. Your sed command doesn't have a file to operate on, the goal of the script is not quite clear, and in general there are some coding improvement opportunities.
Do you want to operate on the files listed in "blocks.txt", or do you just want the single file "rules.txt" to be modified?

That is a useless use of cat, also. while read ... done < inputfile is more efficient and has fewer side-effects.