---
title: "Changing EOL markers"
date: "2015-03-20"
category: "control-panel"
slug: "changing-eol-markers"
---

End-of-line (EOL) markers vary by operating system and can cause issues with shell scripts, .htaccess files, and mail filters on Linux-based hosting. This article explains the differences and how to convert them.

## EOL Markers by Operating System

| Operating System | EOL Characters | Notation |
|---|---|---|
| Windows | Carriage return + newline | `\r\n` |
| Linux/Unix | Newline | `\n` |
| Mac (classic) | Carriage return | `\r` |

## Why EOL Markers Matter

Most cross-platform languages (PHP, Python, Ruby) handle all EOL styles transparently. However, certain files on a Linux hosting environment are strict about EOL format:

- **Shell scripts** fail to execute if any EOL other than `\n` is used, particularly in the [shebang](http://en.wikipedia.org/wiki/Shebang_%28Unix%29) line
- **[[htaccess-guide]] directives** break when Mac-style `\r` markers are present
- **[[mail-filtering]] recipes** require `\n` markers up to [[determining-platform-version]], after which only Mac-style `\r` markers are rejected

**Best practice:** Always use Linux-style EOL markers (`\n`) for files on your hosting account.

## Converting EOL Markers

Convert EOL markers within the [[logging-into-the-control-panel]] via **Files** > **File Manager**:

1. Browse to the directory containing the file
2. Hover over the row with the file
3. Select **Properties** under the _Actions_ column to open the file properties dialog
    ![File properties dialog](kb-image:file-permission-screen.png)
    *File properties dialog*
4. Click **Windows > Unix** or **Mac > Unix** depending on the file's origin

This converts `\r\n` to `\n` or `\r` to `\n` respectively, making the file compatible with the Linux hosting platform.

### Automatic EOL Conversion

Shell scripts beginning with a shebang (`#!`) automatically have their EOL markers converted to Unix-style (`\n`).

### Setting EOL When Editing Files

When editing a file in the File Manager, expand the EOL dropdown above the file contents and select the appropriate marker before saving.

![EOL selector in Files > File Manager > Edit File](kb-image:apnscp-eol.png)
*EOL selector in Files > File Manager > Edit File*
