invoke unix variable in SED command

Hi,

I am trying tio invoke unix variable in a sed command like below, but it seems to be failing..

a=1
sed -n '$a,$p' file.txt    ### Failing

but

a=1
sed -n '1,$p' files.txt    ### Works fine

Please help me to fix this... Thanks in advance

Try...

a=1
sed -n "$a,$ p" file.txt

Thatz working!! Thanks a lot for your help!!