LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   problem with Migrating code base from windows to linux (https://www.linuxquestions.org/questions/linux-general-1/problem-with-migrating-code-base-from-windows-to-linux-517926/)

mohit.malik 01-10-2007 01:57 AM

problem with Migrating code base from windows to linux
 
Apologies if this question has already been answered.

I have migrated my code base from windows to linux. The problem iam facing is that some Ascii files have a ^M character at the end of each line. for eg i hada batch file on windows and i copied that to a .sh file in linux and it flashed me with errors.

is ther any tool as such designed for copying the files from windows to linux keeping the characristics of the file in tact. what can be the best possible solution of migrating the code base.

thanks

Simon Bridge 01-10-2007 04:10 AM

The thing you want is dos2unix.

Quote:

If you need to exchange text files between DOS/Win and Linux, be aware of the ``end of line'' problem. Under DOS, each line of text ends with CR/LF (that is, ASCII 13 + ASCII 10), with LF under Linux. If you edit a DOS text file under Linux, each line will likely end with a strange--looking `M' character; a Linux text file under DOS will appear as a kilometric single line with no paragraphs. There are a couple of tools, dos2unix and unix2dos, to convert the files.
... from From DOS/Windows to Linux HOWTO

timmeke 01-10-2007 08:49 AM

Or use FTP to transfer files.
It has an "ascii" mode that deals with similar CR/LF problems.


All times are GMT -5. The time now is 04:57 PM.