dos2unix using sed – How to remove ^M chars from a DOS file
After dos2unix using vim, here is dos2unix using sed
in bash you could type the following command:
# sed 's/^M$//' input.txt > output.txt
or you can convert UNIX to DOS by typing the following command:
# sed 's/$'"/`echo \\\r`/" input.txt > output.txt
If you found useful this article, please share it using the social buttons below. Thank you in advance,
Gg1.

