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
I suspect that what you need is an array, but that will restrict you to newer bashes. It is saver than using eval.
dirs=( /"content with spaces"/{dev01,dev02} )
dirs=( /content/{dev01,dev02} )
ls -l "${dirs[@]}"
/content/{dev01,dev02}
will expand to:
"/content/dev01" "/content/dev02"
The existence of those directories is irrelevant to the expansion.
It becomes unpredictable when you assign a variable to a brace expansion.
dirs=/content/{dev01,dev02}
may turn into
"/content/dev01"
or
"/content/dev01 /content/dev02"
or
"/content/dev01" "/content/dev02"
or
"/content/{dev01,dev02}"
If you quote the braces in any way they will not expand, so the result will contain the braces and be mostly meaningless.