title: Bash script parameter expansion
body: <p>I have a script:</p>
  
  <pre><code>#!/bin/bash
  SINGLE_FILE=/tmp/blah.file
  MULTIPLE_FILES=/tmp/{dir1,dir2}/*.file
  
  cp $SINGLE_FILE $MULTIPLE_FILES /tmp/newDir
  </code></pre>
  
  <p>This will fail with:</p>
  
  <blockquote>
    <p>cp: cannot stat `/tmp/{dir1,dir2}/*.file': No such file or directory</p>
  </blockquote>
  
  <p>It looks like the script is not expanding out the wildcards in my variables.  So I can make this script work with:</p>
  
  <pre><code>eval cp $SINGLE_FILE $MULTIPLE_FILES /tmp/newDir
  </code></pre>
  
  <p>My question is: Why is the script not expanding my variable in the first place?  Also, is there a different way to solve this other than using <code>eval</code>?</p>