Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-10-2007, 01:57 AM   #1
LQ Newbie
Registered: Jan 2007
Posts: 1

Rep: Reputation: 0
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.

Old 01-10-2007, 04:10 AM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
The thing you want is dos2unix.

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
Old 01-10-2007, 08:49 AM   #3
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrating from Windows to Linux vimalgoyal Linux - Software 7 11-21-2006 05:48 PM
migrating windows raid to linux sigmaes Linux - Hardware 1 11-05-2005 03:45 PM
Migrating from Windows XP to Linux... big_lou Linux - Newbie 5 06-05-2005 08:16 PM
Migrating from Windows to Linux sandman867 Linux - Newbie 3 11-16-2004 03:02 AM
migrating C code from linux to windows Paula01 Linux - General 2 03-13-2002 10:22 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration