Quote:
As a minor correction to what bakunin wrote, actually ^M doesn't stand for carriage return, it means the character M at beginning of line (i.e. beginning of file or immediately after a line feed).
You are right, of course. The reason for this is the only way i ever had to use "^M" was to remove DOS-style CR/LFs from text documents, like
sed 's/^M$//' document
therefore seeing the "^M" evocated this Pavlovian reflex in me - "use of ^M must mean remove CR/LFs" and i didn't even read any further. Of course "^M" means, in the normal sense of a non-escaped character, an M at the beginning of a line like you pointed out correctly.
Sigh, this comes from working in DOS/Windows-contaminated environments for too long. I probably got infected.
bakunin