title: BASH output column formatting
body: <p>First time posting. HELLO WORLD. Working on my first script that just simply checks if a list of my websites are online and then returns the HTTP code and the amount of time it took to return that to another file on my desktop.</p>
  
  <p>-- THIS SCRIPT WILL BE RUNNING ON MAC OSX --</p>
  
  <p>I would like to amend my script so that it formats its output into 3 neat columns.</p>
  
  <p>currently</p>
  
  <pre><code>#!/bin/bash
  file="/Users/USER12/Desktop/url-list.txt"
  printf "" &gt; /Users/USER12/Desktop/url-results.txt
  while read line
  do
      printf "$line" &gt;&gt; /Users/USER12/Desktop/url-results.txt
      printf "\t\t\t\t" &gt;&gt; /Users/USER12/Desktop/url-results.txt
      curl -o /dev/null --silent --head --write-out '%{http_code} %{time_total}' "$line" &gt;&gt; /Users/USER12/Desktop/url-results.txt
      printf "\n" &gt;&gt; /Users/USER12/Desktop/url-results.txt
  done &lt;"$file"
  </code></pre>
  
  <p>which outputs in the following format</p>
  
  <pre><code>google.com              200 0.389
  facebook.com                200 0.511
  abnormallyLongDomain.com                200 0.786
  </code></pre>
  
  <p>but i would like to format into neat aligned columns for easy reading</p>
  
  <pre><code>DOMAIN_NAME                 HTTP_CODE   RESPONSE_TIME
  google.com                  200         0.389
  facebook.com                200         0.511
  abnormallyLongDomain.com    200         0.486
  </code></pre>
  
  <p>Thanks for the help everyone!!</p>