[SOLVED] sed command

Help request,

I have tsted this line of code for hours. The first line works and the second line returns the message " sed: command garbled.....". This
is running on solaris. The "${} variables all have good values when echoed.

 ##       /bin/sed -n '1,25p' ${file} >> ${MailFile}
           /bin/sed -n '${start},${end}\p' ${file} >> ${MailFile}

(script output)

sed: command garbled: ${start},${end}\p

Thank you
GRM

 sed -n "${start},${end}p" file

fyi , your example give the same results. "sed: command garbled: ${start},${end}p "
Thank you for your efforts, GRM

---------- Post updated at 12:14 PM ---------- Previous update was at 11:02 AM ----------

pravin27, I did not see the double quote at first. Your command is correctly working.
Thank you, GRM

I ran pravin27's sed command on my Solaris 9 box running ksh and it works fine.

What shell are you using??
Perhaps the shell is not evaluating the command line arguments correctly.

Just for fun, try eval'ing this command and see what happens:

mycmd='sed -n "${start},${end}p" ${file}'
eval $mycmd