title: Bash check if file exists with double bracket test and wildcards
body: <p>I am writing a Bash script and need to check to see if a file exists that looks like <code>*.$1.*.ext</code> I can do this really easily with POSIX test as <code>[ -f *.$1.*.ext ]</code> returns true, but using the double bracket <code>[[ -f *.$1.*.ext ]]</code> fails. </p>
  
  <p>This is just to satisfy curiosity as I can't believe the extended testing just can't pick out whether the file exists. I know that I can use <code>[[ `ls *.$1.*.ext` ]]</code> but that will match if there's more than one match. I could probably pipe it to <code>wc</code> or something but that seems clunky.</p>
  
  <p>Is there a simple way to use double brackets to check for the existence of a file using wildcards?</p>
  
  <p>EDIT: I see that <code>[[ -f `ls -U *.$1.*.ext` ]]</code> works, but I'd still prefer to not have to call ls.</p>