shell program with sed

I want to substitute a charactor "PAN" with "TAN" in a shell, I used sed command in shell, it wo'nt work but the same is run from command prompt it was successful. the command is

sed ' s/PAN/TAN/g ' <i/p> > <o/p>
sed ' s/^M/^M/g ' <i/p> > <o/p> (1st ^M is Ctrl+V+M, 2nd should be line feed/next line)

the same problem is with delete option in sed

Please suggest

---------- Post updated at 08:44 AM ---------- Previous update was at 08:27 AM ----------

actually file consist of single line with multiple ^M character, i am trying to convert all ^M character into line feed i.e new line (so that single line file become multiple line sequential file), the same works from comman line but not from shell program.

thanks

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

Proceed here:

Thank You.

The UNIX and Linux Forums.