From: Timothy Hunter Date: 2006-11-02T09:44:56+09:00 Subject: Re: counter Gennady Bystritsky wrote: > list-bounce@example.com wrote: > (snip) >> but I don't want a linebreak after the counter is displayed. I want it >> just to keep refreshing itself, basically. Am I missing something >> with puts or print or p? Any ideas? >> > > $stdout.sync = true > 20.times do |_counter| > counter = _counter.to_s > print counter + "\b" * counter.size > sleep 1 > end > > FYI: puts and p both add "\n" to the output if it is not yet there. printf doesn't