eol
Convert between different end-of-line (EOL) formats
TLDR
List all available products
Get EoLs of one or more products
Open the product webpage
Get EoLs of a one or more products in a specific format
Get EoLs of one or more products as a single markdown file
Display help
SYNOPSIS
Not Applicable. eol is a fundamental concept in text encoding and processing, not an executable Linux command. Therefore, it does not have a command synopsis, options, or arguments in the traditional sense. Its behavior is manifested through how different operating systems and text processing tools interpret and handle line endings.
DESCRIPTION
EOL (End Of Line) refers to special characters that mark the end of a line of text in a file. In Linux and Unix-like systems, the standard EOL character is the Line Feed (LF), represented as \n (ASCII 10). Windows systems typically use a Carriage Return followed by a Line Feed (CRLF), represented as \r\n (ASCII 13 + ASCII 10). While eol is not a standalone Linux command, understanding EOL character conventions is crucial for text file compatibility across different operating systems and for proper functioning of various text processing utilities. Misinterpreting or mishandling EOL characters can lead to display issues, parsing errors, or script failures, particularly when moving files between Windows and Linux environments. Many standard Linux commands implicitly or explicitly handle or are affected by EOL conventions when processing text streams or files.
CAVEATS
The primary caveat regarding EOL is the fundamental difference in line ending conventions between operating systems, primarily between Linux/Unix (LF) and Windows (CRLF). Shell scripts or text files originating from Windows environments often contain CRLF line endings. When these files are executed or processed on a Linux system, the \r (Carriage Return) character is interpreted as part of the command or data, leading to "command not found" errors or unexpected behavior. Tools like dos2unix are essential to convert CRLF to LF for proper Linux compatibility. Conversely, unix2dos is used for conversion in the opposite direction.
<B>COMMON EOL CHARACTER REPRESENTATIONS</B>
The specific byte sequence for an EOL varies by operating system:
- Linux/Unix/macOS (since OS X): Line Feed (LF), represented as ASCII 10 or \n.
- Windows: Carriage Return + Line Feed (CRLF), represented as ASCII 13 followed by ASCII 10, or \r\n.
- Classic Mac OS (pre-OS X): Carriage Return (CR), represented as ASCII 13 or \r.
<B>IMPACT ON SHELL SCRIPTING</B>
A common pitfall for users new to Linux or cross-platform development is running shell scripts authored on Windows. If a script created on Windows (with CRLF EOLs) is transferred to a Linux system and executed directly, the shell interpreter will encounter the \r character at the end of each line. This can cause the shell to interpret command names or arguments incorrectly, often leading to errors such as "command not found" or unexpected syntax errors. Using utilities like dos2unix to convert the script's line endings to LF before execution is a standard practice to avoid such issues.
HISTORY
The concept of End-Of-Line characters dates back to the mechanical operations of typewriters and early teletypewriters. A new line required two distinct actions: moving the carriage to the beginning of the line (Carriage Return, \r) and advancing the paper one line (Line Feed, \n). Early computer systems inherited these conventions. Unix-like systems, developed at Bell Labs, adopted the simpler approach of using only the Line Feed (\n) to signify a new line, primarily for efficiency and simplicity. Microsoft DOS and later Windows systems, however, maintained the Carriage Return followed by Line Feed (\r\n) convention, inheriting it from CP/M and earlier systems. This historical divergence continues to be a common source of interoperability issues in cross-platform text processing and development.
SEE ALSO
dos2unix(1): Converts Windows (CRLF) line endings to Unix (LF) line endings., unix2dos(1): Converts Unix (LF) line endings to Windows (CRLF) line endings., cat(1): Can display non-printing characters, including EOLs, using options like -v or -A (--show-all)., sed(1): A stream editor often used for find-and-replace operations, including manipulation of EOL characters., awk(1): A powerful text processing tool that can parse and manipulate data based on record (line) and field delimiters, including EOLs., file(1): Can sometimes identify the EOL format (e.g., "with CRLF line terminators") of a text file.