Help with invoking sed from a script

Hello

I have a .sh script that needs to take a template and replace zzz in the template file with the user's name. I cannot figure out how to make the following work from my script (works from the command prompt) but not when I put it inside a *.sh script

sed 's/xxx/$USER/g' template.conf > text.txt

Like I said the above line works from the cmd line but not from inside the script. How can I make it expand properly?

thanks in advance
--a

Use double quotes instead of single..Double quote expands the variable..

sed "s/xxx/$USER/g" template.conf > text.txt

Thanks for the very prompt response. Worked!! I was getting confused by the fact that the command needed the single quotes and I thought I had to somehow leave them there...

thanks a million again
--a