title: Shell: How to append a prefix while looping through an array?
body: <p>I'm trying to loop through an array and append a prefix to each value in the array. Simplified version of the code:</p>
  
  <pre><code>#!/bin/sh
  databases=( db1 db2 db3 )
  for i in live_${databases[@]} stage_${databases[@]}
  do
      ....
  done
  </code></pre>
  
  <p>However, it only prepends the prefix to the first value in the array - the values it loops through are:</p>
  
  <pre><code>live_db1 db2 db3 stage_db1 db2 db3
  </code></pre>
  
  <p>Any thoughts? Thanks.</p>