When the following two lines of code are executed in a bash script, \"ls\" complains that the files don\'t exist:
dirs=/content/{dev01,dev02}
ls -l $dirs
Here is an excellent discussion of what you are trying to do.
The short answer is that you want an array:
dirs=(/content/{dev01,dev01})
But what you do with the results can get more complex than what you were aiming for I think.
The issue which no-one has addressed is that the variable assignment makes the difference.
dirs=/content/{dev01,dev02}
expands differently than
echo /content/{dev01,dev02}
The question is how to assign the results of the expansion to dirs
See: How to use Bash substitution in a variable declaration