Questions tagged [eol]

EOL is short for "end of line". In text files each line is terminated with characters such as linefeed or carriage return or a combination thereof.

EOL stands for "end of line" and refers to the various character or combination of characters that signify the end of each line of a text-based file.

For historical reasons there are various common EOLs:

  • linefeed or newline, ASCII 0x0A: common on systems with Unix heritage including Mac OS X
  • carriage return + linefeed, ASCII 0x0D 0x0A: common on systems with Microsoft DOS and Windows heritage and in text-based internet protocols
  • carriage return, ASCII 0x0D: used on Apple Macintosh up to System 7

These differences can present problems when using files and source code on multiple operating systems. Issues may be encountered with text editors, compilers, and revision controls systems.

See also

380 questions
20
votes
3 answers

Windows CRLF to Unix LF Issues in Vagrant

I'm working on provisioning a few VMs using Vagrant. Here's the situation: Host: Windows 7 (64-bit) Guest: Ubuntu 14.04 (64-bit) I am having an issue getting the CRLF line endings to convert to LFs. This is causing the bash scripts in the shared…
Jonathan
  • 671
  • 1
  • 8
  • 21
20
votes
5 answers

Portable end of line

is there any way to automatically use correct EOL character depending on the OS used? I was thinking of something like std::eol? I know that it is very easy to use preprocessor directives but curious if that is already available. What I am…
Andrew
  • 2,309
  • 4
  • 27
  • 42
18
votes
8 answers

"Inconsistent line ending style" nightmare

I'm completely stuck with an SVN error when committing 2447 files at once. I'm using TortoiseSVN (latest version) on Windows 7 64 bits. The fact is that some files were created on Mac, and others on PC, so TortoiseSVN stopped the commit with an…
Epoc
  • 7,208
  • 8
  • 62
  • 66
17
votes
9 answers

can't install pip anymore with python 2.7?

I wanted to use a python script compatible with python 2.7 (but not 3.8) I need pip to make the script work but looks like I can't install pip anymore ? I tried with get-pip.py , but it's not working : user@DESKTOP-J9T7UBF $ get-pip.py DEPRECATION:…
colorf
  • 171
  • 1
  • 1
  • 3
16
votes
3 answers

What the point of using std::ios_base::binary?

I had a issue with Linux file reading under Window. Here is the issue discussion: Using fstream::seekg under windows on a file created under Unix. The issue was workarounded by opening the text file with std::ios_base::binary specified. But what's…
jpo38
  • 20,821
  • 10
  • 70
  • 151
15
votes
3 answers

Enforce core.autocrlf=input through .gitattributes

Is there a way to enforce core.autocrlf=input from within the .gitattributes in order to propagate the policy throughout my colleagues? In detail what I want is to convert to lf on add and leave as is on checkout. The problem is that neither text…
laertis
  • 8,229
  • 4
  • 21
  • 17
15
votes
2 answers

VI Editor: Move to EOL instead of last character

I'm most often finding myself having to work with plain old vi on minimalistic terminals that tend to act differently than the vim on big distros, and so the behavior trips me up. What I want to know is not how to move to the last character in the…
Dylan LaCoursiere
  • 493
  • 1
  • 8
  • 18
14
votes
3 answers

How to find and remove the invisible characters in text file using emacs

I have a .txt file named COPYING which is edited on windows. It contains Windows-style line breaks : $ file COPYING COPYING: ASCII English text, with CRLF line terminators I tried to convert it to Unix style using dos2unix. Below is the output : $…
Talespin_Kit
  • 20,830
  • 29
  • 89
  • 135
14
votes
3 answers

Force svn:eol-style=native on the server?

Currently, in order to ensure the subversion property eol-style is set to native for each new file added to our project, we have to add this to the ~/.subversion/config file on each of our developers machines: [miscellany] enable-auto-props =…
Bart
  • 1,928
  • 2
  • 14
  • 13
14
votes
2 answers

How to remove ^M in emacs

How can I remove ^M characters in Emacs? It doesn't work using dos2unix filename or unix2dos filename. Normally I cannot see any ^M characters, but this is what came out when using the command cat -A filename : Please explain it in plain words...…
user3647551
  • 141
  • 1
  • 3
13
votes
8 answers

How to find a windows end of line (EOL) character

I have several hundred GB of data that I need to paste together using the unix paste utility in Cygwin, but it won't work properly if there are windows EOL characters in the files. The data may or may not have windows EOL characters, and I don't…
Stephen Turner
  • 2,574
  • 8
  • 31
  • 44
12
votes
3 answers

how to avoid git-apply changing line endings

I have a git repo set with core.eol=crlf, core.autocrlf=true and core.safecrlf=true. When I apply a patch from another crlf repo and to my repo all the line endings for the effected file are changed to lf. Currently I'm applying the patch as so: git…
m0tive
  • 2,796
  • 1
  • 22
  • 36
12
votes
2 answers

Why does .gitattributes not override core.autocrlf configuration on Linux?

While setting up Git for a project, I've noticed that the line-ending normalization works a bit different on Linux and on Windows. As I understand the Git documentation on this subject, the behavior on Windows is the correct one. Specifically, when…
jgreen81
  • 705
  • 1
  • 6
  • 14
12
votes
2 answers

How to avoid mixed eol-styles in a svn repository

Is there a best practice for preventing mixed eol-styles in a subversion repository. I know that svn:eol-style=native can be set as an auto-prop, but I would have to ensure that it was set for all committers. I'm also reluctant to do a…
Ken
  • 77,016
  • 30
  • 84
  • 101
11
votes
3 answers

Make Git use CRLF on its "<<<<<<< HEAD" merge lines

Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging? If resolving conflicts in a text editor without visible EOL characters, it is easy to accidentally end up with these LFs…
Jamie Humphries
  • 3,368
  • 2
  • 18
  • 21
1 2
3
25 26