I have a perl script that does some printing on a unix machine and it takes several minutes to finish. What i want to do is create a "status" bar that gives the progress of the script. My problem is that I can print something like...
0%[ ]100%
which then goes to...
0%[==== ]100%
once some time has gone by, but I don't know how to print the second status bar _over_ the first (i.e. without a newline). I tried printing backspaces like "\b" to stdout, and that didn't work. So basicly I want this to happen...
# perl test.pl /tmp/files
Printing 987 files: 0%[ ]100%
Completed!
#
... where the space in the status bar fills up with "=" without moving down a new line each time. Anyone know how to pull this off?
0%[ ]100%
which then goes to...
0%[==== ]100%
once some time has gone by, but I don't know how to print the second status bar _over_ the first (i.e. without a newline). I tried printing backspaces like "\b" to stdout, and that didn't work. So basicly I want this to happen...
# perl test.pl /tmp/files
Printing 987 files: 0%[ ]100%
Completed!
#
... where the space in the status bar fills up with "=" without moving down a new line each time. Anyone know how to pull this off?