inserting a variable to a new line

In my script I am using sed to insert a line.

Suppose I have a variable called ck_size=5 and a temporary file called tmp

I want to add a certain line in the tmp file .Please see the below command

sed -i '2a\maitee is $ck_size'  /dun/homes/lrsprod/tmp

I want in 2 line of tmp file it should show maitree is 5.
Please help as the above command is not picking ck_size value. I am using tcsh shell.

sed -i "2a\maitee is $ck_size"  infile

it is not working

Better use awk with -v for variable substitution.

awk -v var="$your_variable" 'action' 

What sed version your using..?(guess its GNU sed..however) Post output of sed --version. And it also depends where your variable $ck_size is defined. Is it any kind of env variable and you run the sed command in the commmand line or all these sed and variable $ck_size are defined inside a script file..? However try.

 sed -i ' 2a\mama is here '"$ck_size"' ' inputfile

GNU sed version 4.1.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.

ck_size is not env variable.could you please help me.

Where do you run this sed command? At command prompt or it lies inside a file..? Did you get any output to the sed command in post# 5? As an alternate try with awk..

ck_size=5
awk -v d="$ck_size" 'NR==2{print "values is " d}1' inputfile

At command prompt I am trying to run .Yes I got output but that line was not inserted in the file. Please tell me how to insert the line using sed.