title: Bash: how to process variables from an input file?
body: <p>I've got a bash script that reads input from a file like this:</p>
  
  <pre><code>while IFS="|" read -r a b
  do
     echo "$a something $b somethingelse" 
  done &lt; "$FILE"
  </code></pre>
  
  <p>The file it reads looketh like this:</p>
  
  <pre><code>http://someurl1.com|label1
  http://someurl2.com|label2
  </code></pre>
  
  <p>However, I'd like to be able to insert the names of variables into that file when it suits me, and have the script process them when it sees them, so the file might look like this:</p>
  
  <pre><code>http://someurl1.com?$VAR|label1
  http://someurl2.com|label2
  </code></pre>
  
  <p>So <code>$VAR</code> could be, for example, today's date, producing an output like this:</p>
  
  <pre><code>http://someurl1.com something label1 somethingelse
  http://someurl2.com?20100320 something label2 somethingelse
  </code></pre>