Hi there, I'm trying to write a simple bash script but something seems wrong, I'm testing the following on the command line:
DATE="2010-09-{10,11}"
result=`\ls *ext.$DATE.Z`
and results in ls: cannot access *ext.2010-09-{10,11}.Z: No such file or directory
but if I execute this:
result=`\ls *ext.2010-09-{10,11}.Z`
it works flawlessly...
I even tried to remove the quotation marks from DATE parameter but that isn't the problem, bash manual isn't helping, what am I doing wrong? Wasn't it supposed to execute parameter substitution and pass it to my command?
I thought I should have to escape the $ sign but that didn't work either.
EDIT - Explanation on purpose added
What I am trying to accomplish is to populate variable result with all filenames that match the given pattern (*ext.2010-09-{10,11}), I know I can solve this using a for cycle but I thought about using curly braces for shortness.