in reply to Oddity with \r printing

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