Say I have a simple perl program:
for my $i (0..10) {
print "$i\r"
}
print "\n"
Now if I run the program through shell-command
,
instead of getting a single line with 10
, I will see the following thing
in the output buffer.
0^M1^M2^M3^M4^M5^M6^M7^M8^M9^M10^M
My question is how can I make the output look like the way similar to shell output (i.e. \r
moves to the begin of a line, further output overwrites previous one, and \n
switches to a newline).