User Tools

Site Tools


scripting:eol

This is an old revision of the document!


Table of Contents

Scripting - EOL

Some hints about the EOL characters on windows and linux.

Overview

Linux Windows
Written-out line feed carriage return and line feed
Short cut LF CRLF
Meta chars \n \r\n
ASCII-Code 0a 0d0a

Real life

Create files which contain only the EOL characters.

# printf "\n" > linux
# printf "\r\n" > win

Show hexdump of the files.

# xxd linux 
00000000: 0a                                       .
# xxd win 
00000000: 0d0a                                     ..

Let file classify the files.

# file linux 
linux: very short file (no magic)
# file win 
win: ASCII text, with CRLF line terminators

Look how GNU cat prints the EOL characters.

# cat -A linux 
$
# cat -A win 
^M$
scripting/eol.1457382155.txt.gz · Last modified: 2016-03-07 21:22 by root