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
For folks (like me) finding this through Google, @Peter and @feoh's answers are the general solution to "How to glob variables in bash script".
list_of_results=(pattern)
will save existing filenames matching pattern into the array list_of_results. Each element of list_of_results will hold one filename, spaces and all.
You can access each result as "${list_of_results[ for starting from 0. You can get the entire list, properly quoted, as "${list_of_results[@]}".