Ncurses may be the way to go. Since you said program, then ncurses, c, c++. Look into all of it. But if you plan on doing just something "shelL" related, go with perl.
Edit: To add onto my point, here's some modules that can give you an idea.
http://metacpan.org/pod/Curses::UI::Dialog::Progress
http://metacpan.org/pod/Smart::Comments
window.clrtobot()
And for good measure, a call for curses to clear the whole window.