From: Tim Pease Date: 2006-11-08T11:24:51+09:00 Subject: Re: How to make a cycling counter from commandline? On 11/7/06, David Vallner wrote: > Tim Pease wrote: > > That should do you what you want. The secret is the carriage return > > "\r" at the beginning of the print string. That will bring the cursor > > back to the beginning of the line and then overwrite anything > > currently on that line. > > > > Smells unportable between Linux, Windows, and Mac Classic. Then again, I > don't know what approach Ruby takes to newline-handling on non-Unix > platforms. > "\r" is completely portable. win32 platforms use a "\r\n" for the end of a line, and *NIX uses just a single "\n" -- hence the dos2unix utility. Now, the ANSI control character to clear to the end of a line (mentioned earlier in this thread) is definitely not portable to the win32 cmd shell. TwP