Error ^M not found while using read command

Hi guys,
i have a script called readnametest.i had written like this

# !/bin/ksh
echo "enter your name please"
read x;
echo " your name is $x"

i am getting an error like "readnametest.ksh[3]: ^M: not found." while executing this one.Could any one please explain me on why this error is coming.am i writing the read command syntax in a proper way or not?
i am new to the unix scripting.

thanksinadvance
narasimharao.

What shell/editor are you using ?

hi agn,
i am using kornshell currently.i am stuck of here.please help me on this.

thanks
narasimharao.

The ^M is a DOS carriage return. Use a tool like unix2dos to clean out any DOS line endings from the script file.

In UNIX try

more scriptname.sh

You will see ^M characters at the end of each line - this is a Windows text file.
unix2dos may also be called ux2dos on your system.