I can do this:
Code:
#!/bin/zsh
ls /home/Berticus/something/{one,two,three}/test | wc -l
However, if I try to do this:
Code:
#!/bin/zsh
BASEDIR=/home/Berticus/something
DIRS=one,two,three
echo $BASEDIR/{$DIRS}/test
ls $BASEDIR/{$DIRS}/test | wc -l
It tells me
Code:
ls: cannot access /home/Berticus/something/{one,two,three}/test: No such file or directory
Why is it being treated so literally? I tried escaping the brackets as well, but that didn't help at all. I also tried simplifying it to:
Code:
DIRS=/home/Berticus/something/{one,two,three}/test
ls $DIRS | wc -l
And I still got the same results