title: How to assign a glob expression to a variable in a Bash script?
body: <p>When the following two lines of code are executed in a bash script, "ls" complains that the files don't exist:</p>
  
  <pre><code>dirs=/content/{dev01,dev02}
  ls -l $dirs
  </code></pre>
  
  <p>When I run the script with the -x option, it appears to be passing the variable within single quotes (which would prevent globbing):</p>
  
  <pre><code>+ dirs=/content/{dev01,dev01}
  + ls -l '/content/{dev01,dev01}'
  ls: /content/{dev01,dev01}: No such file or directory
  </code></pre>
  
  <p>If I execute the "ls" command from my interactive shell (sans quotes), it returns the two directories.</p>
  
  <p>I've been reading through the Bash Reference Manual (v 3.2) and can't see any reason for filename globbing to not take place (I'm not passing -f to the shell), or anything that I can set to ensure that globbing happens.</p>