views:

333

answers:

4

Is tab character in "\t" or "\r\t" in Solaris ? And the new line character sequence \n or \r\n ?

thanx

A: 

A tab character is "\t", always. A newline on Solaris is "\n", the only time a newline is "\r\n" is in DOS/Windows land.

Greg Hewgill
And for many network protocols.
Joey
+6  A: 
  • \t = tab
  • \r = carraige return
  • \n = newline

Solaris standard line delimiter is \n

SillyMonkey
A: 

Tab is always "\t", carriage-return is "\r", and newline is "\n".

To be very specific, the end-of-line (EOL) marker on DOS-based systems is "\r\n". It's apparently just a carriage-return on early Apple systems, and just newline on most others.

Chris Arguin
Windows also uses CRLF and can hardly be considered DOS-based anymore ...
Joey
Apple II and every Mac OS up to 9 use "\r" Anything after that uses "\n"
Glen
Thanks for the feedback. I forgot about the Apple behavior; never had to program one of those.
Chris Arguin
A: 

thanx for the help. I actually was looking for the escape characters for the above sequences on Windows, since a solaris backend is sending me text which is read on a windows OS.

OverTheEdge