"\n" and "\r"

Started by alex, February 02, 2006, 11:40:30 AM

Previous topic - Next topic

alex

I use WindowsXP and have simple program in file test.lsp:
(print "nnnnn")
(exit)
I run cmd.exe and execute command
newlisp test.lsp > test.txt
Then I see, that size of file test.txt is 10 and it contain

"nrnrnrnrnr"

It is normal?

Lutz

#1
Yes, this is normal: it will translate UNIX line terminators "n" to "rn" line terminators on the MS-Windows platform.



Keep this in mind when porting newLISP scripst to UNIX, if they run as shell scripts with:



#!/usr/bin/newlisp



in the first line, they will fail if they have Windows line terminators, and have to be translated first (i.e. using dos2unix)



Lutz

alex

#2
I can't express my mind in english enough,

but it is very interesting information not only for me :-)