title: bash script to check file name begins with expected string
body: <p>Running on OS X with a bash script:</p>
  
  <pre><code>sourceFile=`basename $1`
  shopt -s nocasematch
  if [[ "$sourceFile" =~ "adUsers.txt" ]]; then echo success ; else echo fail ; fi
  </code></pre>
  
  <p>The above works, but what if the user sources a file called <code>adUsers_new.txt</code>?</p>
  
  <p>I tried:</p>
  
  <pre><code>if [[ "$sourceFile" =~ "adUsers*.txt" ]]; then echo success ; else echo fail ; fi
  </code></pre>
  
  <p>But the wildcard doesn't work in this case.
  I'm writing this script to allow for the user to have different iterations of the source file name, which must begin with <code>aduser</code> and have the <code>.txt</code> file extension.</p>