Linux Line Feed? Carriage Return? Remove ^M

linux "^M" issue

If you look the shell script or code sent from Windows to the Linux server, you may find "^M" at the end of the line.

ex 1 )
echo test^M


ex 2)

#include <iostream>^M
#include <string>^M


Solve :

all remove ^M

 $ vi source.cpp
 
:1,$s/^M//g

^M : ctrl+N and ctrl+M


No comments:

Post a Comment

Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore!

 🏙️ Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore! 🚨 Are you thinking about buying an apartment in 2025? 🏢  It’...