[ubuntu-za] Line feed on terminals

Charl Wentzel charl.wentzel at vodamail.co.za
Thu Feb 25 21:12:11 GMT 2010


Hi Guys

I keep hitting these really odd issues.  Some I can sort out and for
others I'm just glad this list exists!

I have a command line application that outputs status messages to the
console as it runs.  In my c++ code I use the following:

cout << "status message \n";

When I log into a virtual terminal and run it all output lines appear
below each other as exptected:

Line 1
Line 2
Line 3
...

However, when I start the application from rc.local and redirects its
output such that it runs on a virtual terminal (where no one has logged
in) the output appear as follows:

Line 1
          Line 2
                     Line 3
                               ...

It appears something changes on the terminal once someone has logged in.
I could fix the problem by changing my c++ code to:

cout << "status message \r\n";

This forces a carriage return (like on the old typewriters).  However,
these output command are spread out over several files on serveral
applications and it would be a mammoth task to fix.

Is there something I can call from rc.local that would change the
behaviour of a virtual terminal (similar to that once someone has logged
in)?  I've looked at the setterm man page, but couldn't find anything
there.

Regards
Charl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-za/attachments/20100225/40f3c985/attachment.htm 


More information about the ubuntu-za mailing list