Originally Posted by honem
Doesn't work
I pasted the code into a new script and chmod'd the file.
I execute and it truncates each line with a "r" character ????
|
Hmm, the shell may be using the slashes and escaping the backslash portion of the carriage return. Try changing the sed command to this and see if it works:
Code:
sed -e 's:$:\r:' $1 > $2
If it still has issues, you can try adding an extra backslash to the above in front of \r (e.g. \\r). Some shells handle things a bit differently and I can't remember which incarnation of "/bin/sh" is used by Macs these days.