title: Can I reference an existing bash variable by joining variables together?
body: <p>I've defined a variable say: </p>
  
  <p><code>bob_pants="fancy"</code></p>
  
  <p>and now I want to reference the contents of <code>$bobs_pants</code> by using another variable.</p>
  
  <pre><code>name="bob"
  item="pants"
  </code></pre>
  
  <p>Can I do something like:</p>
  
  <p><code>echo "${name} has ${name}_${item} ${item}"</code></p>
  
  <p>I want the output for the above to be <code>"user bob has fancy pants"</code>
  So far I've only succeeded in getting <code>"user bob has bob_pants pants"</code></p>
  
  <p>I guess I need some way for<code>${name}_${item}</code> to be seen as <code>${bob_pants}</code> but all the ways I tried to group the variables into one haven't worked.</p>