>>> As you've discovered, quoting prevents wildcard expansion. So leave out
>>> the quotes.
> As an aside, note that the glob is not expanded when it is
> assigned to the variable even without the quotes:
>$ a=file*
>$ echo "$a"
>file*
>$ echo $a
>file1 file2 file3 file4 file5 file6 file7 file8 file9
One thing to watch out for is system differences w.r.t quote characters
within the variable when doing filename expansion from a variable, eg;
$ touch 'file\\'
$ a='file\*'
$ set -x
$ : $a
On some systems the last line will match the file 'file\\' because
the variable $a is interpreted as a filename pattern for example in
pdksh and NetBSD/sh you get;
+ : file\\
On other systems the backslash actually protects the file pattern '*'
so for example in bash you get;
+ : 'file\*'
Another problem with putting entire patterns in variables is with
ksh brace expansion (also done after the variable substitution),
e.g (pdksh);
$ a='a{1,2}*'
$ touch 'a{1,2}'
$ set -x
$ : $a
+ : a1* a2*
$
Oh, and I think the OP meant 'ankle' Chris - then his pattern would
match perfectly :)
seeyafrom
l