LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-10-2007, 02:57 AM   #1
mohit.malik
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.

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

Rep: Reputation: 197Reputation: 197
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
 
Old 01-10-2007, 09:49 AM   #3
timmeke
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.
 
  


Reply

Tags
migration


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 06:48 PM
migrating windows raid to linux sigmaes Linux - Hardware 1 11-05-2005 04:45 PM
Migrating from Windows XP to Linux... big_lou Linux - Newbie 5 06-05-2005 09:16 PM
Migrating from Windows to Linux sandman867 Linux - Newbie 3 11-16-2004 04:02 AM
migrating C code from linux to windows Paula01 Linux - General 2 03-13-2002 11:22 AM


All times are GMT -5. The time now is 07:48 PM.

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