title: How to print out to the same line, overriding previous line?
body: <p>Sometimes I see some commands in the terminal that print results to stdout but in the same line. For example wget prints an arrow like below:</p>
  
  <pre><code>0[=&gt;        ]100%
  0[  =&gt;      ]100%
  0[    =&gt;    ]100%
  0[      =&gt;  ]100%
  0[        =&gt;]100%
  </code></pre>
  
  <p>but it is printed out to the same line so it looks like the arrow is moving. How can I achieve the same thing in my programs using bash or sh? Do I need to use other tools?</p>
  
  <p>UPDATE:</p>
  
  <p>I know I mentioned wget, which comes by default in linux, GNU based unices ... Is there a general approach that works on BSDs too? (like OSX) -> OK, If I use bash instead of sh then it works :)</p>