No, Unix does indeed use only \x0A as the line terminator.

$ cat > test this is a test this is a test this is a test 12345678901234 $ od -t x1 test 000000 74 68 69 73 20 69 73 20 61 20 74 65 73 74 0a 74 000020 68 69 73 20 69 73 20 61 20 74 65 73 74 0a 74 68 000040 69 73 20 69 73 20 61 20 74 65 73 74 0a 31 32 33 000060 34 35 36 37 38 39 30 31 32 33 34 0a 000074 $ \ls -l test -rw------- 1 ikegami users 60 May 19 09:40 test

Not only do you see only "0a" without any "0d" in the binary dump, The file size indicates FreeBSD uses only one (60/4 - 14 = 1) character for the newline. From experience, the same applies to Linux, SunOS/Solaris and AIX. The Macs do something different, but I'm not sure what.


In reply to Re^2: Ascii upload ruins the file by ikegami
in thread Ascii upload ruins the file by Monk_Novice

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.