title: Filenames with wildcards in variables
body: <pre><code>#!/bin/bash
  outbound=/home/user/outbound/
  putfile=DATA_FILE_PUT_*.CSV
  cd $outbound
  filecnt=0
  for file in $putfile; do let filecnt=filecnt+1; done
  echo "Filecount: " $filecnt
  </code></pre>
  
  <p>So this code works well when there are files located in the outbound directory.  I can place files into the outbound path and as long as they match the putfile mask then the files are incremented as expected.</p>
  
  <p>Where the problem comes in is if I run this while there are no files located in <code>$outbound</code>.
  If there are zero files there <code>$filecnt</code> still returns a <code>1</code> but I'm looking to have it return a <code>0</code> if there are no files there.  </p>
  
  <p>Am I missing something simple?</p>