newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: alex on February 02, 2006, 11:40:30 AM

Title: "\n" and "\r"
Post by: alex on February 02, 2006, 11:40:30 AM
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?
Title:
Post by: Lutz on February 02, 2006, 12:06:14 PM
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
Title:
Post by: alex on February 04, 2006, 07:08:31 AM
I can't express my mind in english enough,

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