When we download something or install software via Terminal, we always see a number show the progress to us.
The number is changed, but it still in the same line.
How can I do in the bash?
I'm a new basher, help!
When we download something or install software via Terminal, we always see a number show the progress to us.
The number is changed, but it still in the same line.
How can I do in the bash?
I'm a new basher, help!
The trick is to use \r
instead of \n
at the end of the line:
echo -n " 50% complete."$'\r'; sleep 1; echo "100% complete."