title: Bash Shell echo/printf how to format output the right way
body: <p>My current snippet of code looks like this ...</p>
  
  <pre><code>#Location of network config files
  nfds="/etc/sysconfig/network-scripts/"
  
  #Standard prefer of network config files
  fil="ifcfg-"
  
  #Array variable that feeds "$nic"
  cards= array loop built from "nic=$(ls /sys/class/net | grep en)"
  
  #Set color for Divice labile
  div="\033[38;5;39m"
  
  #Set Fix format and colour info
  fix="\033[38;5;118m"
  
  #Set color for OK
  ok="\033[38;5;28m"
  
  #Clear All font and color info
  ctf="\033[0m"
  
  function currentCardDefRoute(){
  
      defr=$(grep DEFROUTE $nfds$fil$cards | cut -d = -f 2) 
  
      if [[ $defr = "yes" ]] || [[ $defr = "no" ]]; then
          echo -e " "$div$cards$ctf"'s current default route is\t"$div$defr$ctf"\t\t\t\t   ["$ok"OK"$ctf"]"
          $st
      else
          echo -e " "$div$cards$ctf"'s current default route is \t"$fix"Missing"$ctf"\t\t\t   ["$fix"PLEASE FIX"$ctf"]"
          $st
      fi
  
  }
  </code></pre>
  
  <p>I indent 1 space on all echo lines for readability and consistent formatting. Keeping output readable and easy to understand.</p>
  
  <p>Im looking to us the "columns" option and make the output more dynamic and have the format consistent no matter the screen size or var result. I would love to also get rid of all the "\t"s in my code. I have tried printf to no success.</p>
  
  <p>I googled a lot of different ways and not seen the specific answer Im looking for or a variation I can draw an answer from.</p>
  
  <p>Thank you for your help.
  btw. This is the first code I have ever written so go easy guys :)</p>