dos to unix CR/LF conversion?

James McIntosh jemcinto-cpI+UMyWUv+w5LPnMra/2Q at public.gmane.org
Sun Nov 9 16:41:31 UTC 2003


At 11:35 AM 11/9/03 -0500, Henry Spencer <henry-lqW1N6Cllo0sV2N9l4h3zg at public.gmane.org> wrote:
>On Sun, 9 Nov 2003, James Knott wrote:
>> > Unix end-of-line is ASCII LF = linefeed = newline = \n = \012 = ^J.  ...
>> 
>> You should indicate you're using octal for \012.
>
>The backslash-digits notation is always octal.  However, I should have
>mentioned that, for the benefit of newcomers.

Yes and no. It's slightly more complex than that.

When the backslash is followed immediately by zero, then it is octal.

When the backslash is followed immediately by a digit other than zero, or a
letter A to F, or a to f, then it is hexadecimal.

For example:

\070 is octal.
\70 is hexadecimal
\ae is hexadecimal
\AE is hexadecimal
\2B is hexadecimal

The \ can be considered to be a modal transition code (escape code), and
the 0 can be considered to be a modal subtransitional code (secondary-level
escape code).



--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list