Is there a way to use a Filename Expansion within a test expression, more specifically, a bash conditional expression?
For example:
[[ -f foo* ]] && echo 'found it!' || echo 'nope!';
... will output "nope!" either if the foobar file exists on the current directory or not.
And adding a var like...
bar=foo*
[[ -f `echo $bar` ]] && echo 'found it!' || echo 'nope!';
... will output "found it!" if the foobar file exists, but only if the echo $bar expansion returned only one file.