As noted \r is a carriage return. You then have to overwrite the content of the line. printf allows you to ensure all lines are 'the same width' so overwite the previous content completetely. The Curses library allows you to manipulate a terminal screen with a lot more precision than \r or \b You may find the example at A du(1) real-time sorter using Curses easy to modify for your purposes.
cheers
tachyon
In reply to Re: Oddity with \r printing
by tachyon
in thread Oddity with \r printing
by MrMadScience
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |