as Danny Y. already said, the line will work, the inverse areas will also do the trick:
(0..100).each { print "\b"*20+it+"%" sleep 100 }
I had to rewrite multi-line output - the solution I found was
print "\r\n"*80
to scroll through all the old content from the screen is not a good solution, but it works on a Windows shell :-)
source share