Wednesday 24 October 2012

Moving file between Windows and Linux change the EOL characters

I needed to commit a shell script to the Jenkins CI.
So first moved the script from the Linux machine to my local working copy (on Windows) and then commited it to the SVN. It turned out I could not execute the script after checkout on a Linux machine and reason was the the file transfer from Linux to Windows changed the EOL (End Of Line) endings to Windows format (CR/LF) replacing the LF format of UNIX.

To fix it, open script in Notepad++ -> Edit -> EOL conversion -> UNIX format

Then commit and should work after being checkout on Linux machine.

Also, I had tried to change encodings to whatever possible in Notepad++ and left it to Unicode-8. Again, that was a reason script to not be possible to run on Linux. So, change Encoding to "ASCII" by "Convert to ASCII"

No comments:

Post a Comment