sed working on command line but file unchanged when execute with Shell script

I have a simple task to replace unix line feed end of line characters with carriage returns.

When I run the following �change file in place� sed instruction from the command line all the Line feeds are successfully replaced with Carriage returns.

sed -i 's/$/\r/' lf_file.txt

But that same command when run within a shell the file remains unchanged.
Within the shell I do change directory first and tried a fully qualified path as well.
I also tried having sed create an new file with carriage returns with the same negative results.

I have a feeling has something do with standard in or standard out.

Do I need some sort of redirect, pipe or here document when invoking the sed command within the shell?

I recall needing to some like this years ago with a similar command.

This GNU sed script is not replacing line feeds, but placing carriage return character in front of the linefeeds, effectively making it Windows format..

--
With regards to it not working "within a shell". I do not understand that you mean by that. Do you mean a shell script?
What is your OS and version?