title: Can I align variables in a string with echo and bash?
body: <p>I want to do formatting using echo in shell scripting.</p>
  
  <p>Here is a small code snippet which is giving me the problem:</p>
  
  <pre><code>echo -en "\rFileName    :   $filename   :    $index of $lines Completed"
  </code></pre>
  
  <p>The <code>$filename</code> is a string with varying length, and this is causing problem with formatting in the terminal. How can I overcome this?</p>
  
  <p>Here's what I mean:</p>
  
  <pre class="lang-none prettyprint-override"><code>FileName :       a800_102 :    6 of 6 Completed
  FileName :       ersf_1024    :    56 of 56 Completed
  </code></pre>
  
  <p>I would like to have a table format when I display it on the terminal.</p>