Placing a comment at the beginning of a line

Hello -

I am running Linux. I want to place a comment char at the beginning of a line in a file. For example:

testvar=`grep username /etc/people

sed -e 's/$testvar/#$testvar/g' /etc/people

I cannot get the above commands to put a comment at the beginning of the line.

Any advice is appreciated!
Thanks,
mike

With awk:

awk '/username/{print "#" $0}' /etc/people
sed -e '/username/ s!^!#!' /etc/people

Thanks for the inputs. That worked!