On Wed, Feb 19, 2014 at 04:51:36PM +0000, Brett Parker wrote:
On 19 Feb 16:44, Chris Green wrote:
ENOTTRUE, echo, by default, won't do CR/LF, just LF. About the only place that a CR/LF pair is still used is in DOS format text files.
It depends how you interpret things.
It certainly *does* echo a CR/LF pair to the screen because otherwise the cursor wouldn't return to the LHS.
EWRONGAGIN ;)
No I'm not, we're arguing at cross purposes.
echo -ne "test\n"
I.e. *only* echo the line feed, no carriage return. Note that your terminal still returns the cursor possition. See for example:
Only because something in between is adding the CR. If the terminal was in a different mode where the CR isn't added the cursor wouldn't go to the LHS.
UNIX systems have only ever bothered using the line feed character to mean both, it's up to the terminal what to do.
Yes, absolutely, a much more sensible approach than CR and LF. But it only works because of processing in between by the terminal driver which adds the CR back when outputting to real-world devices.