Unix and windows file formats are different. Sometime a Unix file which edit in Windows put a special character at the end of each line i.e ^M (CTRL+M). It can make that file useless sometime.
But no worry you can fix that with ease, just follow the procedure given below:
- Open the file in vim or vi
- Then press ESC key, and type
- Remember ^M is a special character which can be generated as given in NOTE.
sed command can also be used for this as follows:
sed 's/^M//g' myfile> newfile
^M is also a special character here.
That’s all, your file is same as last.
NOTE: Hold the control key and then press v and m to get the ^M (CTRL+M) character.