Textual oddity

This is my first post!! I really hope this question hasn't been asked a thousand times before(I'll bet it has).

Anyway, here it is. I am new to the UNIX world by the way so forgive my ignorance. OK, whenever I write code on my windows machine and then try to port it over to UNIX I always get some bizarre newline character problems. So my question is how does the UNIX world represent the newline character exactly? Its \n in Windows. I know this is a dumb question hehe.

Also, if anyone knows why exactly emailing text files using MS Outlook to UNIX causes so many porting problems that would be helpful as well.

Thanks in advance!

Actually, it is NOT "\n" in Windows. The OS actually
converts text files to represent end-of-line as "\r\n" (CR-LF) when
stored to disk. UNIX however has no such "oddities".
UNIX text files use "\n" to represent end-of-line.
Actually, to UNIX, there is no difference between a binary
or a text file when stored on disk.
If you are using some sort of Windows to UNIX FTP program,
usually selecting "text" file format will do the conversion
for you. Some editors will also do this conversion for you.

Check and see if your system as `unix2dos` and `dos2unix` installed. This can be used to remove the extra chars. There are several simple sed scripts availabe as well.

ftp usually works well for me. If you establish an ftp connection to your UNIX box, then at the prompt:

ftp> ascii
ftp> put myfile.txt

If you do this, it will transfer your file without any funky characters. This also happens if you transfer a file with the "binary" setting active as opposed to "ascii" as above.

There are some very good ftp programs, like CuteFTP, which work very well and are easy to use.

:cool: