title: Wild card search to CD
body: <p>I'm trying to search for the first matching directory with a wildcard in a bash shell script, it seems to be working fine on a few systems, and not on others. Is there any way around this to have it work on all Centos version? I am running 6.3, then it works, but Centos 6.4 on a VPS it doesn't work, it outputs files instead of just directory:</p>
  
  <p>Here is what I got:</p>
  
  <pre><code>DAHDI=$(ls -d -1 /usr/src/dahdi-linux-complete* | head -n1);
  
  cd "$DAHDI"
  </code></pre>
  
  <p>Any kind of help I can get on this is greatly appreciated.</p>