title: Right align a part of the string with Bash
body: <p>I would like to right align the memory usage while keeping the services left aligned.<br>
  I'm using <code>printf '%-1s %-25s %s\n' $ok $service $memory</code> and the result is:</p>
  
  <pre><code>[OK] gitea                     142.2M
  [OK] mariadb                   73.0M
  [OK] nginx                     9.5M
  </code></pre>
  
  <p>I would like something more like this:</p>
  
  <pre><code>[OK] gitea                     142.2M
  [OK] mariadb                    73.0M
  [OK] nginx                       9.5M
  </code></pre>
  
  <hr>
  
  <p><strong>Edit</strong><br>
  What about rendering these strings?</p>
  
  <pre><code>sdusage=88
  cpuusage=5
  swapusage=44
  temp="50"
  sdusagetext="SD usage is $sdusage%"  
  cpuusagetext="CPU usage is $cpuusage%"  
  swapusagetext="SWAP usaage is $swapusage%"
  temptext="Temperature is $temp°C"
  </code></pre>
  
  <p>Is there a better approach than this one?</p>
  
  <pre><code>printf '%-1s %-3s %-26s %6s\n' $sdusagetext
  printf '%-1s %-3s %-25s %6s\n' $cpuusagetext
  printf '%-1s %-3s %-24s %6s\n' $swapusagetext
  printf '%-1s %-24s %6s\n' $temptext
  </code></pre>