CRLF vs LF: Line Ending Differences and How to Fix Them
Windows CRLF vs Unix LF line endings: why they differ, how they break scripts and diffs, and how to normalize line endings in Git, editors, and CI.
Published:
Tags: text, developer-tools, programming
CRLF vs LF: Line Ending Wars Between Windows and Unix If you have ever opened a file in a text editor and seen characters everywhere, or had a shell script fail with "bad interpreter: No such file or directory" despite the file existing, you have been a victim of mixed line endings. The vs problem is one of the oldest cross-platform compatibility issues in computing, and it still bites developers regularly. -------|------------|-----------| | Windows | CRLF | | | Unix / Linux | LF | | | macOS (modern) | LF | | | macOS (pre-OS X) | CR | | | HTTP protocol | CRLF | | | SMTP (email) | CRLF | | --- Why Mixing Line Endings Causes Problems Shell Scripts Fail A shell script saved with Windows line endings will fail on Linux: If this script has endings, the shebang line becomes . Linux tries to…
All articles · theproductguy.in