title: Forcing bash to expand variables in a string loaded from a file
body: <p>I am trying to work out how to make bash (force?) expand variables in a string (which was loaded from a file).</p>
  
  <p>I have a file called "something.txt" with the contents: </p>
  
  <pre><code>hello $FOO world
  </code></pre>
  
  <p>I then run</p>
  
  <pre><code>export FOO=42
  echo $(cat something.txt)
  </code></pre>
  
  <p>this returns: </p>
  
  <pre><code>   hello $FOO world
  </code></pre>
  
  <p>It didn't expand $FOO even though the variable was set. I can't eval or source the file - as it will try and execute it (it isn't executable as it is - I just want the string with the variables interpolated). </p>
  
  <p>Any ideas? </p>