In a terminal i ran cat script.r | hexdump -C | head
and amongst the output returned found a 0d 0a
, which is DOS formatting for a new line (carriage return 0d
immediately followed by a line feed 0a
). I ran the same command on another_script.r i was merging with but only observed 0a
, no 0d 0a
, indicating Unix formatting.
To check further if this was the source of the ^M line endings, script.r was converted to unix formatting via dos2unix script.r
& verified that 0d 0a
was converted to 0a
using hexdump -C as above. I performed a merge using Meld in attempting to replicate the process which yielded ^M line endings in my script's. I re-oppened both files in Emacs/ESS and found no ^M line endings. Short of converting script.r back to dos formatting and repeating the above procedure to see if the ^M line endings re-appear, i believe i've solved my ^M issue, which simply is that, unbeknownst to me, one of my files was dos formatted. My take home message: in a Windows dominated environ, never assume that one's personal linux environment doesn't contain DOS bits. Or line endings.