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.