Try the following:
perl -e 'for($i = 0; $i < 100; $i++){ print STDERR "$i"; sleep 1 ; print STDERR "\r"}'
(I used STDERR, to avoid buffering of stdout. There is a way to disable this, but I can't recall it off the top of my head).
On Friday, January 31, 2003, at 05:11 PM, Peder Axensten wrote:
That was quick!
I have a C++ project in fron of me know, '\r' doesn't work. In terminal it's ignored...
IIRC, the "\r" character should clear the line for you. Let me know if this doesn't work, as I've definitely got code that does this somewhere ...
I'd like to rewrite the same line on standard output. To have a progrss indicator like "Compressing, x% done" that is updated with no line feed. How do I do this in Perl? In C++?
/Peder +46-90-786.7719 (work) +46-90-32344 (home)
